/* ============================================================
   Universal Game AI — Main Stylesheet
   Design: adapted from FynnAI visual identity
   ============================================================ */

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:        #111936;
  --primary-light:  #1b2749;
  --primary-mid:    #17213f;
  --primary-dark:   #070b1c;
  --accent:         #00c7b7;
  --accent-light:   #19e6d2;
  --accent-dark:    #009b91;
  --accent-on-light:#007f78;
  --accent-on-light-soft: rgba(0,127,120,.10);
  --accent-on-light-border: rgba(0,127,120,.24);
  --purple:         #256f86;
  --purple-light:   #46d7c9;
  --green:          #22c55e;

  --text:           #0f172a;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;

  --bg:             #ffffff;
  --bg-subtle:      #f1f5f9;
  --bg-card:        #ffffff;
  --bg-dark:        #070817;
  --bg-dark-2:      #0d1226;
  --bg-dark-card:   #121a31;

  --border:         #e2e8f0;
  --border-subtle:  #f1f5f9;
  --border-dark:    rgba(255,255,255,.1);

  --shadow-xs:      0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:      0 2px 8px rgba(0,0,0,.08);
  --shadow:         0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:      0 16px 48px rgba(0,0,0,.15);
  --shadow-xl:      0 32px 80px rgba(0,0,0,.20);
  --shadow-accent:  0 8px 32px rgba(0,199,183,.30);
  --shadow-video:   0 40px 100px rgba(0,0,0,.5);

  --radius-xs:  6px;
  --radius-sm:  10px;
  --radius:     16px;
  --radius-lg:  24px;
  --radius-xl:  32px;

  --nav-height:      72px;
  --container-width: 1200px;
  --transition:      0.25s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Geologica', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Skip nav ────────────────────────────────────────────── */
.skip-nav {
  position: absolute; top: -100%; left: 1rem;
  background: var(--primary); color: #fff;
  padding: .75rem 1.5rem; border-radius: var(--radius-sm);
  font-weight: 600; z-index: 9999; text-decoration: none;
  transition: top var(--transition);
}
.skip-nav:focus { top: 1rem; }

/* ── Typography ───────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
  font-family: 'Geologica', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--text);
}
h1 { font-size: clamp(2.5rem,5vw,4.5rem); }
h2 { font-size: clamp(2rem,4vw,3rem); }
h3 { font-size: clamp(1.25rem,2vw,1.625rem); }
p  { line-height: 1.7; }

a { color: var(--accent-on-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }

/* ── Layout ──────────────────────────────────────────────── */
.container {
  width: 100%; max-width: var(--container-width);
  margin: 0 auto; padding: 0 2rem;
}
.section     { padding: 7rem 0; }
.section-sm  { padding: 4rem 0; }
.section-dark    { background: var(--bg-dark); color: #f8fafc; }
.section-subtle  { background: var(--bg-subtle); }

/* ── Section header ─────────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 4rem; }

.section-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent-on-light-soft); color: var(--accent-on-light);
  border: 1px solid var(--accent-on-light-border);
  padding: .375rem 1rem; border-radius: 100px;
  font-size: .8125rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.section-title { margin-bottom: 1rem; }
.section-title span {
  background: linear-gradient(135deg, var(--accent-on-light), var(--accent-dark));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-dark .section-title  { color: #f8fafc; }
.section-dark .section-subtitle { color: rgba(248,250,252,.65); }
.section-dark .section-badge {
  background: rgba(0,199,183,.1); color: var(--accent-light);
  border-color: rgba(0,199,183,.25);
}
.section-dark .section-title span {
  background: linear-gradient(135deg, var(--accent-light), var(--purple-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-subtitle {
  font-size: 1.125rem; color: var(--text-muted);
  max-width: 580px; margin: 0 auto; line-height: 1.8;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.75rem; border-radius: 6px;
  font-family: inherit; font-size: .9375rem; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: all var(--transition); white-space: nowrap;
  letter-spacing: -.01em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; box-shadow: var(--shadow-accent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,199,183,.45); color: #fff; }

.btn-secondary {
  background: transparent; color: rgba(248,250,252,.85);
  border: 1.5px solid rgba(255,255,255,.3);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-light); background: rgba(0,199,183,.1); }

.btn-ghost {
  background: transparent; color: var(--accent-on-light);
  border: 1.5px solid var(--accent-on-light);
}
.btn-ghost:hover { background: var(--accent); color: #fff; }

.btn-danger {
  background: #dc2626;
  color: #fff;
  border: 1.5px solid #dc2626;
  box-shadow: 0 8px 24px rgba(220,38,38,.18);
}
.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
  transform: translateY(-2px);
}

.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: #f1f5f9; }

.btn-lg { padding: 1rem 2.25rem; font-size: 1.0625rem; }
.btn-sm { padding: .5rem 1.25rem; font-size: .875rem; }
.btn-full { width: 100%; justify-content: center; }

/* Light bg overrides for secondary */
.section-subtle .btn-secondary,
.auth-form .btn-secondary {
  color: var(--text);
  border-color: var(--border);
}
.section-subtle .btn-secondary:hover,
.auth-form .btn-secondary:hover {
  border-color: var(--accent-on-light); color: var(--accent-on-light); background: var(--accent-on-light-soft);
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height); z-index: 1000;
  background: rgba(11,15,30,.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  transition: all var(--transition);
}
.navbar .container { height: 100%; }

/* Fixed dark navbar palette. The header no longer changes color on scroll
   or on light pages, which keeps shared nav controls predictable. */
.navbar,
.navbar.scrolled,
.nx-page-light .navbar {
  background: rgba(11,15,30,.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

.navbar .navbar-nav a,
.navbar.scrolled .navbar-nav a,
.nx-page-light .navbar .navbar-nav a { color: rgba(255,255,255,.75); }
.navbar .navbar-nav a:hover,
.navbar.scrolled .navbar-nav a:hover,
.nx-page-light .navbar .navbar-nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.navbar .nav-login,
.navbar.scrolled .nav-login,
.nx-page-light .navbar .nav-login { color: rgba(255,255,255,.8); }
.navbar .nav-login:hover,
.navbar.scrolled .nav-login:hover,
.nx-page-light .navbar .nav-login:hover { color: #fff; }
.navbar .hamburger span,
.navbar.scrolled .hamburger span,
.nx-page-light .navbar .hamburger span { background: #fff; }
.navbar .nav-user-btn,
.navbar.scrolled .nav-user-btn,
.nx-page-light .navbar .nav-user-btn { color: rgba(255,255,255,.85); }
.navbar .nav-user-btn:hover,
.navbar.scrolled .nav-user-btn:hover,
.nx-page-light .navbar .nav-user-btn:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.navbar .nav-chevron,
.navbar.scrolled .nav-chevron,
.nx-page-light .navbar .nav-chevron { color: rgba(255,255,255,.6); }

.navbar-inner {
  display: flex; align-items: center;
  justify-content: space-between; height: 100%;
}

.navbar-logo {
  display: flex; align-items: center; gap: .625rem;
  text-decoration: none;
}

.logo-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(0,199,183,.16);
}
.logo-icon--lg {
  width: 42px; height: 42px;
  border-radius: 12px;
}

.logo-wordmark {
  font-family: 'Geologica', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--accent-light), var(--purple-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity var(--transition);
}
.logo-wordmark--lg { font-size: 2rem; }
.navbar-logo:hover .logo-wordmark,
.navbar-logo:hover .logo-icon { opacity: .8; }

.navbar-nav { display: flex; align-items: center; list-style: none; gap: .125rem; }
.navbar-nav a {
  color: var(--text-muted); text-decoration: none;
  font-size: .9375rem; font-weight: 500;
  padding: .5rem .875rem; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.navbar-nav a:hover { color: var(--text); background: var(--bg-subtle); }

.navbar-actions { display: flex; align-items: center; gap: 1rem; }
.lang-form { margin: 0; position: relative; }
.lang-menu { position: relative; min-width: 74px; }
.lang-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: .8125rem;
  font-weight: 800;
  line-height: 1;
  padding: 0 .625rem 0 .75rem;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.lang-trigger:hover,
.lang-menu.open .lang-trigger {
  border-color: var(--accent-on-light);
  color: var(--accent-on-light);
  box-shadow: 0 0 0 3px rgba(0,199,183,.08);
}
.lang-chevron {
  flex-shrink: 0;
  color: currentColor;
  opacity: .75;
  transition: transform var(--transition);
}
.lang-menu.open .lang-chevron { transform: rotate(180deg); }
.lang-menu-list {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  width: 178px;
  padding: .375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.lang-menu.open .lang-menu-list {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  min-height: 38px;
  padding: .5rem .625rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.lang-option small {
  color: var(--text-light);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.lang-option:hover,
.lang-option[aria-selected="true"] {
  background: var(--accent-on-light-soft);
  color: var(--accent-on-light);
}
.lang-option:hover small,
.lang-option[aria-selected="true"] small { color: currentColor; opacity: .75; }
.mobile-lang-form { margin-top: 1rem; }
.mobile-lang-form .lang-menu { width: 100%; }
.mobile-lang-form .lang-menu-list {
  left: 0;
  right: auto;
  width: 100%;
}

/* Dark language switcher in the fixed dark navbar. */
.navbar .lang-trigger,
.navbar.scrolled .lang-trigger,
.nx-page-light .navbar .lang-trigger {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
}
.navbar .lang-trigger:hover,
.navbar .lang-menu.open .lang-trigger,
.navbar.scrolled .lang-trigger:hover,
.navbar.scrolled .lang-menu.open .lang-trigger,
.nx-page-light .navbar .lang-trigger:hover,
.nx-page-light .navbar .lang-menu.open .lang-trigger {
  background: rgba(255,255,255,.14);
  border-color: rgba(0,199,183,.55);
  color: #fff;
}
.navbar .lang-menu-list,
.navbar.scrolled .lang-menu-list,
.nx-page-light .navbar .lang-menu-list {
  background: #111729;
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 18px 45px rgba(0,0,0,.38);
}
.navbar .lang-option,
.navbar.scrolled .lang-option,
.nx-page-light .navbar .lang-option { color: rgba(248,250,252,.88); }
.navbar .lang-option small,
.navbar.scrolled .lang-option small,
.nx-page-light .navbar .lang-option small { color: rgba(248,250,252,.48); }
.nav-login {
  color: var(--text-muted); font-weight: 500; font-size: .9375rem;
  text-decoration: none; transition: color var(--transition);
}
.nav-login:hover { color: var(--text); }

/* User menu */
.nav-user-menu { position: relative; }
.nav-user-btn {
  display: flex; align-items: center; gap: .625rem;
  background: none; border: none; cursor: pointer;
  color: var(--text); font-size: .9375rem; font-weight: 600;
  padding: .375rem .75rem; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.nav-user-btn:hover { background: var(--bg-subtle); color: var(--text); }
.nav-avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.nav-avatar-initials {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; font-size: .8125rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.nav-username { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-chevron { transition: transform var(--transition); color: var(--text-muted); }
.nav-user-menu.open .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute; top: calc(100% + .5rem); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 180px; padding: .375rem;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all var(--transition); z-index: 100;
  display: flex; flex-direction: column; gap: .25rem;
}
.nav-user-menu.open .nav-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown-item {
  display: flex; align-items: center; gap: .625rem;
  padding: .625rem .875rem; border-radius: var(--radius-sm);
  color: var(--text); font-size: .9375rem; font-weight: 500;
  text-decoration: none; transition: all var(--transition);
  background: none; border: none; cursor: pointer; width: 100%;
  font-family: inherit;
}
.nav-dropdown-item:hover { background: var(--bg-subtle); color: var(--accent-on-light); }
.nav-logout-btn { color: var(--text); }
.nav-logout-btn:hover { color: #ef4444; background: rgba(239,68,68,.06); }

/* Dark user dropdown in the fixed dark navbar */
.navbar .nav-dropdown,
.navbar.scrolled .nav-dropdown,
.nx-page-light .navbar .nav-dropdown {
  background: #111729;
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 18px 45px rgba(0,0,0,.38);
}
.navbar .nav-dropdown-item,
.navbar.scrolled .nav-dropdown-item,
.nx-page-light .navbar .nav-dropdown-item {
  color: rgba(248,250,252,.88);
}
.navbar .nav-dropdown-item:hover,
.navbar.scrolled .nav-dropdown-item:hover,
.nx-page-light .navbar .nav-dropdown-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.navbar .nav-logout-btn,
.navbar.scrolled .nav-logout-btn,
.nx-page-light .navbar .nav-logout-btn {
  color: rgba(248,250,252,.88);
}
.navbar .nav-logout-btn:hover,
.navbar.scrolled .nav-logout-btn:hover,
.nx-page-light .navbar .nav-logout-btn:hover {
  color: #fca5a5;
  background: rgba(239,68,68,.08);
}

/* Hamburger */
.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: .5rem; border-radius: var(--radius-sm); flex-direction: column; gap: 5px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text); border-radius: 2px; transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none; position: fixed; top: var(--nav-height);
  left: 0; right: 0; background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem 2rem; box-shadow: var(--shadow-lg); z-index: 999;
}
.mobile-menu.open { display: block; }
.mobile-menu ul { list-style: none; margin-bottom: 1.5rem; }
.mobile-menu ul li { border-bottom: 1px solid var(--border-subtle); }
.mobile-menu ul a {
  display: block; padding: .875rem 0;
  color: var(--text); font-weight: 500; text-decoration: none;
  transition: color var(--transition);
}
.mobile-menu ul a:hover { color: var(--accent-on-light); }
.mobile-menu-actions { display: flex; gap: 1rem; }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  min-height: 100vh; background: var(--bg-dark);
  display: flex; align-items: center;
  position: relative; overflow: hidden;
  padding-top: var(--nav-height);
}

.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(80px); }
.hero-orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0,199,183,.35), transparent);
  top: -250px; right: -150px; opacity: .6;
  animation: orb-float 9s ease-in-out infinite;
}
.hero-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(37,111,134,.35), transparent);
  bottom: -150px; left: -100px; opacity: .5;
  animation: orb-float 12s ease-in-out infinite reverse;
}
.hero-orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(30,27,75,.9), transparent);
  top: 50%; left: 40%; opacity: .7;
  animation: orb-float 15s ease-in-out infinite;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,199,183,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,199,183,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}
@keyframes orb-float {
  0%,100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-20px) scale(1.03); }
}

.hero .container { max-width: 1440px; padding: 0 3rem; }

.hero-content {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 42% 1fr;
  gap: 2rem; align-items: center;
  padding: 5rem 0 6rem;
}
.hero-text {
  max-width: 480px;
  position: relative;
  z-index: 3;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(0,199,183,.1); color: var(--accent-light);
  border: 1px solid rgba(0,199,183,.25);
  padding: .5rem 1.125rem; border-radius: 100px;
  font-size: .8125rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 1.75rem;
}
.hero-badge .dot {
  width: 6px; height: 6px; background: var(--accent);
  border-radius: 50%; animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(1.5); }
}

.hero-title { color: #fff; margin-bottom: 1.5rem; font-size: clamp(2rem,3.5vw,3.25rem); }
.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent-light), var(--purple-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle { font-size: 1rem; color: rgba(248,250,252,.65); margin-bottom: 2.5rem; line-height: 1.85; }
.hero-actions {
  display: inline-flex;
  flex-direction: column;
  gap: .875rem;
}
.hero-btn-row {
  display: flex;
  gap: .875rem;
  align-items: center;
  flex-wrap: wrap;
}
.hero-btn-row .btn { flex-shrink: 0; }
.hero-github-link {
  text-align: center;
  color: rgba(248,250,252,.4);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
  padding: .25rem 0;
}
.hero-github-link:hover { color: rgba(248,250,252,.7); }

/* ── DOWNLOAD ────────────────────────────────────────────── */
.download-hero {
  min-height: calc(100vh - 1px);
}

.download-hero-content {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 5rem 0 6rem;
  text-align: center;
}

.download-hero-content .hero-subtitle {
  max-width: 680px;
}

.download-options {
  display: flex;
  flex-direction: column;
  gap: .875rem;
  align-items: center;
  margin-top: 2.5rem;
}

.download-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
  width: 100%;
  max-width: 620px;
  padding: .75rem 1.25rem;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(15,23,42,.42);
  box-shadow: 0 14px 42px rgba(0,0,0,.2);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.download-card.is-primary {
  gap: 1.15rem;
  padding: 1.5rem;
  border-color: rgba(0,199,183,.46);
  background: rgba(15,23,42,.78);
}

.download-card.is-disabled {
  background: rgba(15,23,42,.46);
}

.download-card:not(.is-primary):not(.is-disabled) {
  min-height: 0;
  padding: .25rem 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.download-card:not(.is-primary):not(.is-disabled) .download-card-head,
.download-card:not(.is-primary):not(.is-disabled) .download-meta {
  display: none;
}

.download-card-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.download-platform {
  color: #f8fafc;
  font-size: 1.125rem;
  font-weight: 700;
}

.download-card.is-primary .download-platform {
  font-size: 1.375rem;
}

.download-status {
  flex-shrink: 0;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: rgba(0,199,183,.12);
  color: var(--accent-light);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.download-card.is-disabled .download-status {
  background: rgba(148,163,184,.14);
  color: rgba(248,250,252,.62);
}

.download-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem .875rem;
  color: rgba(248,250,252,.68);
  font-size: .9375rem;
  line-height: 1.7;
}

.download-meta-empty,
.download-empty {
  display: block;
  max-width: 660px;
}

.download-card .btn {
  margin-top: auto;
}

.download-alt-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(248,250,252,.45);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}

.download-alt-link:hover {
  color: rgba(248,250,252,.72);
}

.download-alt-link svg {
  display: none;
}

.download-empty {
  margin-top: 1.5rem;
  color: rgba(248,250,252,.68);
  line-height: 1.75;
}

.download-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}

.download-info-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.download-info-card h3 {
  margin-bottom: .75rem;
  font-size: 1.125rem;
}

.download-info-card p {
  color: var(--text-muted);
  font-size: .9375rem;
  line-height: 1.7;
}

.download-info-card p + p {
  margin-top: .75rem;
}

/* ── Video widget ────────────────────────────────────────── */
.hero-visual {
  position: relative;
  z-index: 1;
  margin-right: -22vw;
  width: calc(100% + 22vw);
}

.video-widget {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-video), 0 0 0 1px rgba(255,255,255,.08);
  transition: transform .4s cubic-bezier(0.23,1,0.32,1), box-shadow .4s ease;
  transform-style: preserve-3d;
  will-change: transform;
  background: #000;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 85%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 85%, transparent 100%);
}
.hero-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: var(--radius-xl);
}
.video-widget-glow {
  position: absolute; inset: -2px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg,
    rgba(0,199,183,.25) 0%,
    rgba(37,111,134,.2) 50%,
    rgba(0,199,183,.1) 100%);
  z-index: -1;
  filter: blur(20px);
  animation: glow-pulse 4s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%,100% { opacity: .6; }
  50%      { opacity: 1; }
}

/* ── WHAT section ────────────────────────────────────────── */
.what-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 5rem; align-items: center;
}
.what-text .section-badge { margin-bottom: 1.25rem; }
.what-text .section-title { text-align: left; margin-bottom: 1.5rem; font-size: clamp(1.75rem,3.5vw,2.5rem); }
.what-desc { color: var(--text-muted); line-height: 1.85; margin-bottom: 1.25rem; font-size: 1.0625rem; }
.what-desc--muted { color: var(--text-light); font-style: italic; }
.what-chips { display: flex; gap: .625rem; flex-wrap: wrap; margin-top: 1.75rem; }
.chip {
  display: inline-flex; align-items: center;
  padding: .375rem 1rem; border-radius: 100px;
  background: var(--accent-on-light-soft); color: var(--accent-on-light);
  border: 1px solid var(--accent-on-light-border);
  font-size: .8125rem; font-weight: 600; letter-spacing: .03em;
}

/* About image */
.about-img-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}
.about-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Terminal card */
.terminal-card {
  background: var(--bg-dark-card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}
.terminal-top {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.t-dot {
  width: 12px; height: 12px; border-radius: 50%;
}
.t-red    { background: #fb7185; }
.t-yellow { background: #fbbf24; }
.t-green  { background: #34d399; }
.t-title  { font-size: .8rem; color: rgba(255,255,255,.4); margin-left: .5rem; font-family: monospace; }
.terminal-body { padding: 1.25rem 1.5rem; font-family: 'Courier New', Courier, monospace; font-size: .85rem; line-height: 1.9; }
.t-line { display: flex; gap: .5rem; }
.t-prompt { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.t-cmd    { color: #e2e8f0; }
.t-out    { color: rgba(255,255,255,.55); padding-left: 1.25rem; }
.t-muted  { color: rgba(255,255,255,.3); }
.t-accent { color: var(--accent-light); }
.t-green-text { color: #34d399; }
.t-cursor { color: var(--accent-light); animation: blink 1s step-end infinite; padding-left: 1.25rem; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── STEPS section ───────────────────────────────────────── */
.steps-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; position: relative;
}
.step-card {
  padding: 2.5rem 2rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  position: relative;
  transition: all var(--transition);
  overflow: hidden;
}
.step-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple-light));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--transition);
}
.step-card:hover::after { transform: scaleX(1); }
.step-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); z-index: 1; }
.step-card:first-child { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.step-card:last-child  { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }

.step-num-wrap { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.step-num {
  font-size: 3rem; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--accent-on-light), var(--accent-dark));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.04em;
}
.step-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(0,199,183,.3), transparent);
}
.step-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
}
.step-body h3 { font-size: 1.25rem; margin-bottom: .75rem; }
.step-body p  { color: var(--text-muted); line-height: 1.75; font-size: .9375rem; }

/* ── FEATURES section ────────────────────────────────────── */
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.feature-card {
  border-radius: var(--radius-lg); padding: 2rem;
  position: relative; overflow: hidden;
  transition: all var(--transition);
}
.feature-card--dark {
  background: var(--bg-dark-card);
  border: 1px solid rgba(255,255,255,.08);
}
.feature-card--dark::before {
  content: '';
  position: absolute; inset: 0 auto auto 0;
  width: 100%; height: 3px;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--transition);
  background: linear-gradient(90deg, var(--accent), var(--purple-light));
}
.feature-card--dark:hover { transform: translateY(-5px); box-shadow: 0 20px 60px rgba(0,0,0,.4); border-color: rgba(0,199,183,.25); }
.feature-card--dark:hover::before { transform: scaleX(1); }
.feature-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
}
.fi-cyan   { background: rgba(0,199,183,.12);  color: var(--accent); }
.fi-purple { background: rgba(37,111,134,.12);  color: var(--purple-light); }
.fi-green  { background: rgba(34,197,94,.12);   color: var(--green); }
.fi-orange { background: rgba(251,146,60,.12);  color: #f97316; }
.fi-blue   { background: rgba(59,130,246,.12);  color: #60a5fa; }
.fi-pink   { background: rgba(244,63,94,.12);   color: #fb7185; }

.feature-card--dark h3 { font-size: 1.125rem; margin-bottom: .625rem; color: #f8fafc; }
.feature-card--dark p  { color: rgba(248,250,252,.55); font-size: .9375rem; line-height: 1.7; }

/* ── EXAMPLES section ────────────────────────────────────── */
.examples-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.example-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}
.example-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.example-video-wrap {
  position: relative; overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--bg-dark);
  cursor: pointer;
}
.example-video {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.example-card:hover .example-video { transform: scale(1.04); }
.example-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35);
  color: #fff;
  opacity: 0; transition: opacity var(--transition);
  backdrop-filter: blur(2px);
}
.example-card:hover .example-play-btn { opacity: 1; }
.example-play-btn svg { filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.example-overlay {
  position: absolute; top: 1rem; left: 1rem;
}
.example-tag {
  display: inline-block;
  background: rgba(0,199,183,.9);
  color: #fff; font-size: .75rem; font-weight: 700;
  padding: .3rem .75rem; border-radius: 100px;
  letter-spacing: .04em;
  backdrop-filter: blur(4px);
}
.example-body { padding: 1.5rem; }
.example-meta { margin-bottom: .875rem; }
.example-stat {
  display: inline-flex; align-items: center; gap: .375rem;
  font-size: .8125rem; color: var(--text-muted); font-weight: 500;
}
.example-body h3 { font-size: 1.125rem; margin-bottom: .5rem; }
.example-body p  { color: var(--text-muted); font-size: .9rem; line-height: 1.7; }

/* ── FAQ ─────────────────────────────────────────────────── */
.faq-list {
  max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: var(--bg-card); border: none; cursor: pointer; text-align: left;
  font-family: inherit; font-size: 1rem; font-weight: 600; color: var(--text);
  transition: background var(--transition);
}
.faq-question:hover { background: var(--bg-subtle); }
.faq-question[aria-expanded="true"] { background: var(--bg-subtle); color: var(--accent-on-light); }
.faq-icon { flex-shrink: 0; transition: transform var(--transition); color: var(--text-muted); }
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(180deg); color: var(--accent-on-light); }
.faq-answer { padding: 0 2rem 1.5rem; background: var(--bg-subtle); }
.faq-answer p { color: var(--text-muted); line-height: 1.8; font-size: .9375rem; }
.faq-answer[hidden] { display: none; }

/* ── CTA BANNER ──────────────────────────────────────────── */
.cta-banner {
  background: linear-gradient(135deg, var(--bg-dark), var(--bg-dark-2));
  padding: 7rem 0; text-align: center; position: relative; overflow: hidden;
}
.cta-banner-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(0,199,183,.12), transparent 60%),
    radial-gradient(ellipse at 70% 50%, rgba(37,111,134,.12), transparent 60%);
}
.cta-inner { position: relative; }
.cta-banner h2 { color: #fff; margin-bottom: 1rem; }
.cta-banner p  { color: rgba(248,250,252,.6); font-size: 1.125rem; margin-bottom: 2.5rem; max-width: 520px; margin-left: auto; margin-right: auto; }
.cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── FOOTER ──────────────────────────────────────────────── */
.footer { background: var(--bg-dark); color: rgba(248,250,252,.65); padding: 5rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 4rem; }
.footer-logo-link {
  display: inline-flex; align-items: center; gap: .75rem;
  text-decoration: none; margin-bottom: .75rem;
}
.footer-tagline { color: rgba(248,250,252,.45); font-size: .9375rem; line-height: 1.75; margin: 1rem 0 1.5rem; max-width: 280px; }
.footer-social { display: flex; gap: .75rem; }
.social-link {
  width: 38px; height: 38px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5); text-decoration: none;
  transition: all var(--transition);
}
.social-link:hover { background: rgba(0,199,183,.15); border-color: rgba(0,199,183,.3); color: var(--accent); }
.footer-col h4 {
  color: #fff; font-size: .8125rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1.25rem;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: .625rem; }
.footer-links a { color: rgba(248,250,252,.5); text-decoration: none; font-size: .9375rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-link-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(248,250,252,.5); font-size: .9375rem; font-family: inherit;
  padding: 0; transition: color var(--transition);
}
.footer-link-btn:hover { color: var(--accent); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.08);
  font-size: .875rem;
}
.footer-copyright { color: rgba(248,250,252,.35); }
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a { color: rgba(248,250,252,.35); text-decoration: none; transition: color var(--transition); }
.footer-legal a:hover { color: var(--accent); }

/* ── AUTH pages ──────────────────────────────────────────── */
.auth-section {
  min-height: 100vh; background: var(--bg-dark);
  display: flex; align-items: center;
  padding: calc(var(--nav-height) + 3rem) 0 4rem;
  position: relative; overflow: hidden;
}
.auth-bg { position: absolute; inset: 0; pointer-events: none; }
.auth-wrapper { display: flex; justify-content: center; width: 100%; }
.auth-card {
  background: var(--bg-dark-card);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-xl);
  padding: 3rem;
  width: 100%; max-width: 460px;
  position: relative; z-index: 1;
  box-shadow: 0 40px 80px rgba(0,0,0,.4);
  backdrop-filter: blur(10px);
}
.auth-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06); color: rgba(248,250,252,.6);
  border: 1px solid rgba(255,255,255,.08);
  text-decoration: none; transition: all var(--transition);
  margin-bottom: 1.5rem;
}
.auth-back:hover { background: rgba(0,199,183,.12); color: var(--accent); border-color: rgba(0,199,183,.25); }
.auth-logo-mark {
  display: block;
  font-family: 'Geologica', 'Inter', sans-serif;
  font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--accent-light), var(--purple-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.25rem;
}
.auth-header { margin-bottom: 2rem; }
.auth-title { color: #fff; font-size: 1.75rem; margin-bottom: .5rem; }
.auth-subtitle { color: rgba(248,250,252,.5); font-size: .9375rem; line-height: 1.6; }
.auth-confirm-icon {
  width: 64px; height: 64px; border-radius: var(--radius);
  background: rgba(0,199,183,.1); border: 1px solid rgba(0,199,183,.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-light); margin-bottom: 1.5rem;
}

.auth-error {
  display: flex; align-items: flex-start; gap: .625rem;
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.2);
  color: #fca5a5; border-radius: var(--radius-sm);
  padding: .875rem 1rem; margin-bottom: 1.5rem;
  font-size: .9rem; line-height: 1.5;
}
.auth-error svg { flex-shrink: 0; margin-top: .1rem; color: #f87171; }

.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-form .form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block; margin-bottom: .5rem;
  font-size: .875rem; font-weight: 600; color: rgba(248,250,252,.7);
}
.form-input {
  width: 100%; padding: .875rem 1.125rem;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  color: #f8fafc; font: inherit; font-size: .9375rem;
  transition: all var(--transition);
}
.form-input::placeholder { color: rgba(248,250,252,.25); }
.form-input:focus {
  outline: none;
  border-color: rgba(0,199,183,.5);
  background: rgba(0,199,183,.04);
  box-shadow: 0 0 0 3px rgba(0,199,183,.12);
}
.form-input--code {
  font-size: 1.5rem; font-weight: 700; letter-spacing: .2em;
  text-align: center;
}
.input-wrap { position: relative; }
.input-wrap .form-input { padding-right: 3rem; }
.input-eye {
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: rgba(248,250,252,.35); padding: .25rem;
  transition: color var(--transition);
}
.input-eye:hover { color: rgba(248,250,252,.7); }

.auth-form .btn { margin-top: .5rem; }

.auth-switch {
  text-align: center; margin-top: 1.75rem;
  font-size: .9375rem; color: rgba(248,250,252,.45);
}
.auth-switch a { color: var(--accent-light); font-weight: 600; }
.auth-switch a:hover { color: var(--accent); }

/* ── Video Modal ─────────────────────────────────────────── */
.video-modal {
  position: fixed; inset: 0;
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.video-modal[hidden] { display: none; }
.video-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
.video-modal-content {
  position: relative;
  width: 100%; max-width: 960px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,.7);
  background: #000;
  animation: modal-in .22s cubic-bezier(0.23,1,0.32,1);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(.93); }
  to   { opacity: 1; transform: scale(1); }
}
.video-modal-video {
  display: block;
  width: 100%; max-height: 80vh;
  background: #000;
}
.video-modal-close {
  position: absolute; top: .875rem; right: .875rem;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.65);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  z-index: 1;
  transition: background var(--transition), transform var(--transition);
}
.video-modal-close:hover { background: rgba(255,255,255,.15); transform: scale(1.1); }

/* ── Animations ─────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .65s ease, transform .65s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.d1 { transition-delay: .1s; } .d2 { transition-delay: .2s; }
.d3 { transition-delay: .3s; } .d4 { transition-delay: .4s; }
.d5 { transition-delay: .5s; } .d6 { transition-delay: .6s; }

/* ── Utility ────────────────────────────────────────────── */
.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;
}

/* ── Project publishing ─────────────────────────────────── */
.project-hero,
.project-detail-hero {
  background: var(--bg-dark);
  color: #f8fafc;
  padding: calc(var(--nav-height) + 4rem) 0 4rem;
}
.project-hero h1,
.project-detail-hero h1 { color: #fff; max-width: 780px; }
.project-hero-copy { color: rgba(248,250,252,.68); max-width: 640px; margin-top: 1rem; }
.project-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  align-items: end;
  gap: 2rem;
}
.project-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: .75rem;
  padding: .75rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
}
.project-search input,
.project-search select,
.project-input,
.project-editor,
.project-comment-box,
.project-reply-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}
.project-search input,
.project-search select {
  background: rgba(255,255,255,.96);
}
.project-catalog { background: var(--bg-subtle); }
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-height: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,127,120,.35);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.project-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--primary);
  overflow: hidden;
}
.project-thumb img,
.project-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-card-body { display: flex; flex-direction: column; gap: .65rem; padding: 1rem; }
.project-card-body strong { font-size: 1.15rem; line-height: 1.25; }
.project-card-kicker,
.project-card-text,
.project-author,
.project-version-row span { color: var(--text-muted); font-size: .9rem; }
.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: auto;
}
.project-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--accent-on-light-soft);
  border: 1px solid var(--accent-on-light-border);
  color: var(--accent-on-light);
  padding: .25rem .65rem;
  font-size: .82rem;
  font-weight: 600;
}
.project-stats-lg { margin: 1.25rem 0; }
.project-empty {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: center;
  background: #fff;
}
.project-detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}
.project-detail-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}
.project-detail-main .project-author { color: rgba(248,250,252,.65); }
.project-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.project-actions form { display: inline-flex; }
.project-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.5rem;
  align-items: start;
}
.project-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
}
.project-panel h2,
.project-comments h2 { margin-bottom: 1rem; font-size: 1.4rem; }
.project-richtext { color: var(--text); line-height: 1.75; }
.project-richtext ul,
.project-richtext ol { padding-left: 1.35rem; margin: .75rem 0; }
.project-richtext p,
.project-richtext blockquote,
.project-richtext table,
.project-richtext pre { margin: .75rem 0; }
.project-richtext a { font-weight: 600; }
.project-version-list { display: flex; flex-direction: column; gap: .75rem; }
.project-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
}
.project-version-row div { display: flex; flex-direction: column; min-width: 0; }
.project-version-row a,
.project-version-row button {
  border: none;
  background: transparent;
  color: var(--accent-on-light);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.project-version-row a:hover { color: var(--accent-dark); }
.project-version-row button { color: #b91c1c; }
.project-version-row button:hover { color: #7f1d1d; }
.project-comments { max-width: 860px; }
.project-comment-form,
.project-edit-form { display: flex; flex-direction: column; gap: 1rem; }
.project-comment-form { margin-bottom: 1.5rem; }
.project-comment-list { display: flex; flex-direction: column; gap: 1rem; }
.project-comment {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.project-comment header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text);
  font-weight: 700;
  margin-bottom: .5rem;
}
.project-comment header span { color: var(--text-muted); font-weight: 500; font-size: .85rem; }
.project-reply { margin-top: .75rem; margin-left: 1rem; background: var(--bg-subtle); }
.project-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  margin-top: .75rem;
}
.project-reply-form button {
  border: none;
  border-radius: 5px;
  padding: .5rem 1rem;
  color: #fff;
  background: var(--accent-on-light);
  font-weight: 700;
}
.project-dashboard { display: flex; flex-direction: column; gap: 1rem; }
.project-dashboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.project-dashboard-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.project-dashboard-versions { grid-column: 1 / -1; }
.project-analytics-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}
.analytics-overview-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 2rem;
}
.analytics-metric-tile {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
  min-height: 132px;
  padding: 1rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
}
.analytics-metric-tile span {
  color: rgba(248,250,252,.58);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.analytics-metric-tile strong {
  color: #fff;
  font-size: 2rem;
  line-height: 1.05;
  word-break: break-word;
}
.analytics-metric-tile small,
.analytics-chart-card small {
  color: rgba(248,250,252,.64);
  font-size: .82rem;
  font-weight: 700;
}
.analytics-metric-tile small.is-positive,
.analytics-chart-card small.is-positive { color: var(--accent-light); }
.analytics-metric-tile small.is-negative,
.analytics-chart-card small.is-negative { color: #fca5a5; }
.project-dashboard-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.analytics-project-kicker {
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 600;
}
.project-dashboard-main h2 {
  font-size: 1.35rem;
  word-break: break-word;
}
.analytics-project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.analytics-project-stats span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 34px;
  padding: .35rem .65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 600;
}
.analytics-project-stats strong { color: var(--text); }
.analytics-project-stats em {
  color: var(--accent-on-light);
  font-style: normal;
}
.project-analytics-details {
  grid-column: 1 / -1;
  padding-top: .5rem;
}
.project-analytics-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent-on-light);
  font-weight: 800;
}
.analytics-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin-top: .85rem;
}
.analytics-chart-card {
  min-width: 0;
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
}
.analytics-chart-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .2rem .65rem;
  align-items: start;
}
.analytics-chart-card header span {
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
}
.analytics-chart-card header strong {
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.1;
}
.analytics-chart-card header small {
  grid-column: 1 / -1;
  color: var(--accent-on-light);
}
.analytics-sparkline {
  display: block;
  width: 100%;
  height: 72px;
  margin-top: .65rem;
  overflow: visible;
}
.analytics-sparkline line {
  stroke: rgba(100,116,139,.25);
  stroke-width: 1;
}
.analytics-sparkline polyline {
  fill: none;
  stroke: var(--accent-on-light);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.analytics-chart-card footer {
  display: flex;
  justify-content: space-between;
  color: var(--text-light);
  font-size: .72rem;
  font-weight: 700;
}
.project-form-shell { max-width: 860px; }
.project-edit-form label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  color: var(--text);
  font-weight: 700;
}

/* ── Nexusmods-style Project UI ─────────────────────────── */

/* ── Catalog page layout ────────────────────────────────── */
.nx-catalog-page {
  background: #f4f6f9;
  min-height: calc(100vh - var(--nav-height));
  padding-top: calc(var(--nav-height) + 1.5rem);
  padding-bottom: 4rem;
}

.nx-sidebar-toggle {
  display: none;
  align-items: center;
  gap: .5rem;
  margin: 0 1.25rem .875rem;
  padding: .5rem .875rem;
  background: #fff;
  border: 1px solid #dde3ec;
  border-radius: 5px;
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.nx-catalog-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.25rem;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  align-items: start;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.nx-sidebar {
  background: #fff;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  overflow: hidden;
  position: sticky;
  top: calc(var(--nav-height) + 1.25rem);
}

.nx-sidebar form {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 1rem;
}

.nx-sidebar-section {
  padding: .875rem 1rem;
  border-bottom: 1px solid #e8edf4;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.nx-sidebar-heading {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: .25rem;
}

.nx-sidebar-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.nx-sidebar-input {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid #dde3ec;
  border-radius: 5px;
  font: inherit;
  font-size: .875rem;
  color: var(--text);
  background: #f8fafc;
  transition: border-color var(--transition);
}
.nx-sidebar-input:focus {
  outline: none;
  border-color: var(--accent-on-light);
  background: #fff;
}

.nx-check-list {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.nx-filter-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  color: var(--text);
  cursor: pointer;
  padding: .2rem 0;
  transition: color var(--transition);
}
.nx-filter-check:hover { color: var(--accent-on-light); }
.nx-filter-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-on-light);
  cursor: pointer;
  flex-shrink: 0;
}

.nx-sidebar-footer {
  padding: .875rem 1rem 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.nx-clear-link {
  display: block;
  text-align: center;
  font-size: .8125rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: .25rem 0;
  transition: color var(--transition);
}
.nx-clear-link:hover { color: #ef4444; }

/* ── Main content area ───────────────────────────────────── */
.nx-catalog-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Top bar */
.nx-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  padding: .625rem 1rem;
}

.nx-result-count {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.nx-topbar-controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.nx-topbar-label {
  display: flex;
  align-items: center;
  gap: .375rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.nx-topbar-select {
  padding: .3rem .625rem;
  border: 1px solid #dde3ec;
  border-radius: 5px;
  font: inherit;
  font-size: .8125rem;
  color: var(--text);
  background: #f8fafc;
  cursor: pointer;
}

/* ── Project grid ────────────────────────────────────────── */
.nx-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .875rem;
}

.nx-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.nx-card a { text-decoration: none; }
.nx-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  border-color: rgba(0,127,120,.3);
  color: var(--text);
}

.nx-card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--primary);
  flex-shrink: 0;
}
.nx-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.nx-card:hover .nx-card-thumb img { transform: scale(1.05); }

.nx-card-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.15);
}

.nx-card-game-tag {
  position: absolute;
  bottom: .5rem;
  left: .5rem;
  background: rgba(0,0,0,.65);
  color: rgba(255,255,255,.9);
  font-size: .68rem;
  font-weight: 700;
  padding: .2rem .5rem;
  border-radius: 3px;
  letter-spacing: .02em;
  max-width: calc(100% - 1rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.nx-card-body {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .75rem;
  flex: 1;
}

.nx-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 28px;
}

.nx-card-cat {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent-on-light);
  background: var(--accent-on-light-soft);
  border: 1px solid var(--accent-on-light-border);
  padding: .1rem .45rem;
  border-radius: 3px;
  align-self: flex-start;
}

.nx-card-save-form { margin-left: auto; }
.nx-card-save {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dde3ec;
  border-radius: 6px;
  color: var(--text-muted);
  background: #fff;
  cursor: pointer;
  transition: all var(--transition);
}
.nx-card-save:hover,
.nx-card-save-active {
  color: var(--accent-on-light);
  border-color: var(--accent-on-light-border);
  background: var(--accent-on-light-soft);
}

.nx-card-title {
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: .1rem 0;
  text-decoration: none;
}
.nx-card:hover .nx-card-title { color: var(--accent-on-light); }

.nx-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: auto;
  padding-top: .3rem;
}

.nx-card-author {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
.nx-card-author:hover { color: var(--accent-on-light); }
.nx-card-author svg { flex-shrink: 0; color: var(--text-light); }

.nx-card-date {
  font-size: .72rem;
  color: var(--text-light);
  white-space: nowrap;
  flex-shrink: 0;
}

.nx-card-stats {
  display: flex;
  align-items: center;
  gap: .625rem;
  flex-wrap: wrap;
  border-top: 1px solid #f1f5f9;
  padding-top: .5rem;
  margin-top: .25rem;
}

.nx-card-stat {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.nx-card-stat svg { color: var(--text-light); }

.nx-card-ver {
  margin-left: auto;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent-on-light);
  background: var(--accent-on-light-soft);
  border: 1px solid var(--accent-on-light-border);
  padding: .1rem .4rem;
  border-radius: 3px;
}

.nx-empty-grid {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .9375rem;
  background: #fff;
  border: 1px dashed #dde3ec;
  border-radius: 8px;
}

.nx-author-page .container,
.nx-catalog-page > .container {
  padding-top: calc(var(--nav-height) + 2rem);
  padding-bottom: 3rem;
}

.nx-author-header,
.nx-saved-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #dde3ec;
  border-radius: 8px;
}
.nx-author-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-on-light-soft);
  color: var(--accent-on-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  flex-shrink: 0;
}
.nx-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nx-author-summary { flex: 1; min-width: 0; }
.nx-author-summary h1,
.nx-saved-header h1 {
  margin: .2rem 0;
  color: var(--text);
  font-size: 2rem;
  line-height: 1.1;
}
.nx-author-summary p,
.nx-saved-header p { margin: 0; color: var(--text-muted); }
.nx-saved-header { justify-content: space-between; }
.nx-info-link { color: var(--accent-on-light); text-decoration: none; font-weight: 700; }
.nx-info-link:hover { text-decoration: underline; }

/* ── Pagination ──────────────────────────────────────────── */
.nx-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  flex-wrap: wrap;
  padding: .5rem 0;
}

.nx-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 .5rem;
  border: 1px solid #dde3ec;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}
.nx-page-btn:hover { border-color: var(--accent-on-light); color: var(--accent-on-light); background: var(--accent-on-light-soft); }
.nx-page-current { background: var(--accent-on-light); color: #fff; border-color: var(--accent-on-light); }
.nx-page-current:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.nx-page-disabled { opacity: .35; cursor: default; pointer-events: none; }
.nx-page-ellipsis { border: none; background: none; cursor: default; }

/* ── Edit form helper styles ─────────────────────────────── */
.project-field-hint {
  display: block;
  font-size: .78rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: .3rem;
}
.project-field-error {
  display: block;
  font-size: .8125rem;
  color: #dc2626;
  margin-top: .25rem;
}

/* Hero (project list) */
.nx-hero {
  background: var(--bg-dark);
  padding: calc(var(--nav-height) + 3.5rem) 0 3.5rem;
  color: #f8fafc;
}
.nx-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 3rem;
  align-items: end;
}
.nx-hero-title {
  color: #fff;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: .75rem;
}
.nx-hero-sub {
  color: rgba(248,250,252,.6);
  font-size: 1rem;
  line-height: 1.8;
  margin-top: .75rem;
}

/* Search bar */
.nx-search-bar {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}
.nx-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.nx-search-input-wrap svg {
  position: absolute;
  left: .875rem;
  color: rgba(255,255,255,.4);
  pointer-events: none;
}
.nx-search-input-wrap input {
  width: 100%;
  padding: .75rem .875rem .75rem 2.625rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-sm);
  color: #f8fafc;
  font: inherit;
  font-size: .9375rem;
  transition: all var(--transition);
}
.nx-search-input-wrap input::placeholder { color: rgba(248,250,252,.3); }
.nx-search-input-wrap input:focus {
  outline: none;
  border-color: rgba(0,199,183,.5);
  background: rgba(0,199,183,.05);
}
.nx-search-bar select {
  padding: .75rem 1rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-sm);
  color: #f8fafc;
  font: inherit;
  font-size: .9375rem;
  cursor: pointer;
  transition: all var(--transition);
}
.nx-search-bar select:focus { outline: none; border-color: rgba(0,199,183,.5); }
.nx-search-bar option { background: #1b2749; color: #f8fafc; }

/* Catalog section */
.nx-catalog {
  background: #f4f6f9;
  padding: 2.5rem 0 5rem;
  min-height: 50vh;
}

/* Mod list (horizontal cards) */
.nx-mod-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #dde3ec;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.nx-mod-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid #e8edf4;
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
}
.nx-mod-row:last-child { border-bottom: none; }
.nx-mod-row:hover { background: #f8fafc; }

.nx-mod-thumb {
  flex-shrink: 0;
  width: 220px;
  min-height: 130px;
  overflow: hidden;
  background: var(--primary);
  position: relative;
}
.nx-mod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.nx-mod-row:hover .nx-mod-thumb img { transform: scale(1.04); }
.nx-mod-thumb-empty {
  width: 100%;
  height: 100%;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.2);
  background: var(--primary);
}

.nx-mod-body {
  flex: 1;
  padding: 1.125rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}

.nx-mod-top {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  flex-wrap: wrap;
}
.nx-mod-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
  transition: color var(--transition);
}
.nx-mod-row:hover .nx-mod-title { color: var(--accent-on-light); }

.nx-ver-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: .15rem .6rem;
  background: var(--accent-on-light-soft);
  border: 1px solid var(--accent-on-light-border);
  color: var(--accent-on-light);
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
  margin-top: .1rem;
}

.nx-mod-author {
  font-size: .85rem;
  color: var(--text-muted);
}
.nx-mod-author strong { color: var(--accent-on-light); }

.nx-mod-desc {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.nx-mod-stats-row {
  display: flex;
  align-items: center;
  gap: .875rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: .5rem;
}

.nx-stat-item {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
}
.nx-stat-item svg { color: var(--text-light); }

.nx-stat-date {
  margin-left: auto;
  font-size: .8rem;
  color: var(--text-light);
}

.nx-empty {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── Detail page header ────────────────────────────────── */
.nx-detail-header {
  background: var(--bg-dark);
  color: #f8fafc;
  padding-top: calc(var(--nav-height) + 2.25rem);
}

.nx-breadcrumb {
  display: flex;
  align-items: center;
  gap: .375rem;
  font-size: .8rem;
  color: rgba(248,250,252,.35);
  margin-bottom: 1.125rem;
  flex-wrap: wrap;
}
.nx-breadcrumb a {
  color: rgba(248,250,252,.5);
  text-decoration: none;
  transition: color var(--transition);
}
.nx-breadcrumb a:hover { color: var(--accent-light); }
.nx-breadcrumb svg { color: rgba(248,250,252,.2); flex-shrink: 0; }
.nx-breadcrumb span { color: rgba(248,250,252,.65); }

.nx-detail-title {
  color: #fff;
  font-size: clamp(1.625rem, 3vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  line-height: 1.15;
  letter-spacing: -.02em;
}

/* Stats bar — compact strip */
.nx-stats-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 2rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
}
.nx-stat-block {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  background: rgba(255,255,255,.03);
}
.nx-stat-block:hover { background: rgba(255,255,255,.06); }
.nx-stat-block svg { color: var(--accent); flex-shrink: 0; opacity: .85; }
.nx-stat-block div { display: flex; flex-direction: column; line-height: 1.2; }
.nx-stat-block strong {
  font-size: .9375rem;
  font-weight: 700;
  color: #fff;
}
.nx-stat-block span {
  font-size: .68rem;
  color: rgba(248,250,252,.38);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}
.nx-stat-sep {
  width: 1px;
  background: rgba(255,255,255,.09);
  flex-shrink: 0;
  align-self: stretch;
}

/* Gallery + info row — 60/40 */
.nx-detail-content-row {
  display: grid;
  grid-template-columns: minmax(0, 58%) minmax(280px, 42%);
  gap: 1.75rem;
  align-items: start;
  padding-bottom: 2rem;
}
.nx-detail-gallery {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.25);
  aspect-ratio: 16 / 10;
}
.nx-detail-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nx-gallery-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.12);
}

/* Right panel */
.nx-detail-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Info rows — clean list, no heavy dark boxes */
.nx-info-list {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  overflow: hidden;
}
.nx-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .5625rem .875rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.nx-info-row:last-child { border-bottom: none; }
.nx-info-label {
  flex-shrink: 0;
  font-size: .72rem;
  color: rgba(248,250,252,.38);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}
.nx-info-val {
  font-size: .875rem;
  color: rgba(248,250,252,.8);
  font-weight: 500;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Actions — rectangular, not pill */
.nx-detail-actions {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  align-items: stretch;
  width: 100%;
}
.nx-detail-actions .btn {
  border-radius: 5px;
  padding: .625rem 1.25rem;
  font-size: .9rem;
  width: 100%;
  min-width: 0;
}
.nx-detail-actions .big-import-button {
  min-width: 0;
  min-height: 48px;
  justify-content: center;
  font-size: 1rem;
}
.nx-detail-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .625rem;
  width: 100%;
}
.nx-detail-secondary-actions form {
  display: flex;
  align-items: stretch;
  min-width: 0;
}
.nx-detail-secondary-actions form:only-child {
  grid-column: 1 / -1;
}
.nx-detail-secondary-actions .btn {
  height: 100%;
  min-height: 48px;
  padding-inline: .75rem;
  line-height: 1.25;
  white-space: normal;
  text-align: center;
}
.nx-app-import-note {
  max-width: 360px;
  color: rgba(248,250,252,.68);
  font-size: .875rem;
  line-height: 1.55;
}

/* Tab bar */
.nx-tab-bar {
  border-top: 1px solid rgba(255,255,255,.09);
  margin-top: 0;
}
.nx-tabs { display: flex; gap: 0; }
.nx-tab {
  padding: .875rem 1.375rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(248,250,252,.45);
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: .45rem;
  white-space: nowrap;
  margin-bottom: -1px;
}
.nx-tab:hover { color: rgba(248,250,252,.8); background: rgba(255,255,255,.04); }
.nx-tab-active {
  color: #fff;
  border-bottom-color: var(--accent);
}
.nx-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  background: rgba(255,255,255,.1);
  border-radius: 3px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 0;
}
.nx-tab-active .nx-tab-count {
  background: rgba(0,199,183,.2);
  color: var(--accent-light);
}

/* Tab panes */
.nx-tab-pane { display: none; background: #f4f6f9; }
.nx-tab-pane-active { display: block; }
.nx-tab-pane[hidden] { display: none !important; }

.nx-content-wrap {
  padding: 2.5rem 0 5rem;
  max-width: 860px;
}

.nx-content-panel {
  background: #fff;
  border: 1px solid #dde3ec;
  border-radius: var(--radius-sm);
  padding: 2rem;
  box-shadow: var(--shadow-xs);
}
.nx-panel-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* Version list */
.nx-version-list { display: flex; flex-direction: column; gap: .5rem; }
.nx-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  transition: background var(--transition);
}
.nx-version-row:hover { background: #edf2f8; }
.nx-version-info { display: flex; flex-direction: column; gap: .2rem; }
.nx-version-tag {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--text);
}
.nx-version-date {
  font-size: .8125rem;
  color: var(--text-muted);
}
.nx-version-app-note {
  max-width: 240px;
  color: var(--text-muted);
  font-size: .8125rem;
  line-height: 1.45;
  text-align: right;
}

/* Comment feed */
.nx-comment-compose {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}
.nx-compose-footer { display: flex; justify-content: flex-end; }

.nx-comment-feed { display: flex; flex-direction: column; gap: 0; }

.nx-cmt {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.nx-cmt:last-child { border-bottom: none; }

.nx-cmt-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  font-weight: 700;
  border: 2px solid rgba(0,199,183,.2);
}
.nx-cmt-avatar-sm {
  width: 30px;
  height: 30px;
  font-size: .75rem;
}
.nx-cmt-avatar-has-image {
  overflow: hidden;
  background: #fff;
  color: transparent;
}
.nx-cmt-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.nx-cmt-content { flex: 1; min-width: 0; }

.nx-cmt-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.nx-cmt-name { font-weight: 700; font-size: .9375rem; color: var(--accent-on-light); text-decoration: none; }
.nx-cmt-name:hover { color: var(--accent-dark); }
.nx-cmt-role {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: .1rem .5rem;
  border-radius: 999px;
}
.nx-cmt-sep { color: var(--text-light); }
.nx-cmt-date { font-size: .8125rem; color: var(--text-muted); }
.nx-cmt-body { font-size: .9375rem; line-height: 1.7; }

.nx-reply {
  display: flex;
  gap: .875rem;
  margin-top: 1rem;
  padding: .875rem 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-xs);
  border-left: 2px solid rgba(0,199,183,.3);
}

.nx-reply-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .625rem;
  margin-top: 1rem;
}
.nx-reply-compose textarea {
  padding: .625rem .875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg-subtle);
  resize: none;
  transition: border-color var(--transition);
}
.nx-reply-compose textarea:focus { outline: none; border-color: var(--accent-on-light); }
.nx-reply-btn {
  padding: .5rem 1rem;
  border: none;
  border-radius: 5px;
  background: var(--accent-on-light);
  color: #fff;
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  align-self: end;
}
.nx-reply-btn:hover { background: var(--accent-dark); }

.nx-form-message {
  font-size: .85rem;
  font-weight: 600;
  color: #b42318;
}
.nx-comment-compose .nx-form-message,
.nx-reply-compose .nx-form-message {
  grid-column: 1 / -1;
}

.nx-action-pending {
  opacity: .72;
  pointer-events: none;
}

.nx-card-removing {
  opacity: 0;
  transform: scale(.985);
  transition: opacity var(--transition), transform var(--transition);
}

.nx-cmt-new,
.nx-reply-new {
  animation: nx-comment-in .35s ease-out;
}

@keyframes nx-comment-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nx-empty-msg {
  color: var(--text-muted);
  font-size: .9375rem;
  padding: 1rem 0;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer-grid .footer-col:last-child { grid-column: 1 / -1; }
  .examples-grid { grid-template-columns: repeat(2, 1fr); }
  .examples-grid .example-card:last-child { grid-column: 1 / -1; }
  .analytics-overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Catalog: 4 → 3 columns */
  .nx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
  .hero-text { max-width: 100%; }
  .hero-actions { align-self: center; }
  .hero-btn-row { justify-content: center; }
  .download-hero-content { max-width: 100%; text-align: center; }
  .download-options { grid-template-columns: 1fr; }
  .download-card .btn { align-self: center; }
  .download-meta { justify-content: center; }
  .download-info-grid { grid-template-columns: 1fr; }
  .what-grid { grid-template-columns: 1fr; gap: 3rem; }
  .what-text .section-title { text-align: center; }
  .what-chips { justify-content: center; }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .step-card:last-child  { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .navbar-nav, .navbar-actions { display: none; }
  .hamburger { display: flex; }
  .project-hero-grid,
  .project-detail-layout,
  .project-two-column,
  .project-dashboard-row { grid-template-columns: 1fr; }
  .analytics-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-search { grid-template-columns: 1fr; }

  .nx-hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .nx-detail-content-row { grid-template-columns: 1fr; }
  .nx-detail-gallery { max-width: 480px; }
  .nx-stats-bar { flex-wrap: wrap; width: 100%; }
  .nx-stat-block { padding: .5rem .875rem; }
  .nx-mod-thumb { width: 160px; min-height: 100px; }

  /* Catalog grid → 2 columns, sidebar collapses */
  .nx-catalog-layout { grid-template-columns: 1fr; }
  .nx-sidebar {
    display: none;
    position: static;
    order: -1;
  }
  .nx-sidebar.nx-sidebar-open { display: block; }
  .nx-sidebar-toggle { display: flex; }
  .nx-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 640px) {
  .container { padding: 0 1.25rem; }
  .section { padding: 5rem 0; }
  .download-hero-content { padding: 3.5rem 0 4rem; }
  .download-card { min-height: 0; }
  .download-card.is-primary { min-height: 0; }
  .download-card-head { align-items: flex-start; flex-direction: column; }
  .download-card .btn { width: 100%; white-space: normal; }
  .features-grid, .examples-grid { grid-template-columns: 1fr; }
  .examples-grid .example-card:last-child { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
  .footer-legal { flex-wrap: wrap; justify-content: center; gap: .75rem 1.5rem; }
  .cta-actions { flex-direction: column; align-items: center; }
  .mobile-menu-actions { flex-direction: column; }
  .auth-card { padding: 2rem 1.5rem; }
  .faq-question { padding: 1.25rem 1.25rem; }
  .faq-answer   { padding: 0 1.25rem 1.25rem; }
  .project-grid { grid-template-columns: 1fr; }
  .project-analytics-header { align-items: flex-start; flex-direction: column; }
  .analytics-overview-grid,
  .analytics-chart-grid { grid-template-columns: 1fr; }
  .project-reply-form { grid-template-columns: 1fr; }
  .project-dashboard-actions { align-items: stretch; flex-direction: column; }
  .project-dashboard-actions .btn,
  .project-dashboard-actions form,
  .project-dashboard-actions button { width: 100%; }

  .nx-mod-row { flex-direction: column; }
  .nx-mod-thumb { width: 100%; min-height: 180px; }
  .nx-mod-body { padding: 1rem; }
  .nx-stats-bar { flex-wrap: wrap; }
  .nx-stat-sep { display: none; }
  .nx-stat-block { padding: .625rem .875rem; }
  .nx-tab { padding: .75rem .875rem; font-size: .75rem; }
  .nx-reply-compose { grid-template-columns: 1fr; }
  .nx-reply-compose button { width: 100%; justify-content: center; }
  .nx-detail-actions { max-width: none; }
  .nx-detail-actions .btn,
  .nx-detail-actions form,
  .nx-detail-actions form .btn { width: 100%; justify-content: center; }
  .nx-app-import-note { max-width: none; }
  .nx-version-row { align-items: flex-start; flex-direction: column; }
  .nx-version-app-note { max-width: none; text-align: left; }
  .nx-author-header,
  .nx-saved-header { align-items: stretch; flex-direction: column; }
  .nx-author-header .btn { width: 100%; justify-content: center; }
  .nx-author-summary h1,
  .nx-saved-header h1 { font-size: 1.5rem; }

  /* Catalog */
  .nx-grid { grid-template-columns: 1fr; }
  .nx-topbar { flex-direction: column; align-items: flex-start; gap: .625rem; }
  .nx-catalog-page { padding-top: calc(var(--nav-height) + 1rem); }
}
