/* ============================================================
   iamjrmh.xyz - shared styles
   Dark / red / purple portfolio theme
   ============================================================ */

/* ---- Reset --------------------------------------------------- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
img,svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input,textarea,select { font: inherit; }
ul { list-style: none; }

/* ---- Tokens -------------------------------------------------- */
:root {
  --bg:        #07070a;
  --bg-1:      #0a0a10;
  --bg-2:      #101017;
  --surface:   #131320;
  --card:      #111119;
  --card-2:    #16161f;
  --border:    rgba(255,255,255,.065);
  --border-2:  rgba(255,255,255,.12);

  --text:      #ededf2;
  --text-dim:  #a3a3b4;
  --text-mute: #7c7c92;

  --red:        #ff2e43;
  --red-soft:   #ff6473;
  --purple:     #a855f7;
  --purple-soft:#c89bff;

  --grad:  linear-gradient(120deg, #ff2e43 0%, #b23bff 100%);
  --grad-soft: linear-gradient(120deg, rgba(255,46,67,.18), rgba(168,85,247,.18));

  --radius:   14px;
  --radius-lg: 20px;
  --maxw:     1180px;
  --nav-h:    72px;

  --shadow:   0 24px 60px -20px rgba(0,0,0,.7);
  --ease:     cubic-bezier(.22,.61,.36,1);

  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
}

/* ---- Base ---------------------------------------------------- */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* The full background system lives in .bg-fx (injected by script.js).
   See "Site background" section below. */

::selection { background: rgba(255,46,67,.32); color: #fff; }

::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--red), var(--purple));
  border-radius: 99px;
  border: 3px solid var(--bg);
}

/* ---- Layout helpers ----------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.section { padding: 96px 0; position: relative; }
.section-sm { padding: 64px 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--red-soft);
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px;
  background: linear-gradient(90deg, var(--red), transparent);
}

.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -.02em;
  margin: 16px 0 14px;
}
.section-head p { color: var(--text-dim); font-size: 16px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow::before { display: none; }

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

/* ---- Buttons ------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 14.5px;
  padding: 13px 24px;
  border-radius: 11px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .2s, background .2s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(255,46,67,.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(178,59,255,.7); }
.btn-ghost {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-2);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,.08); transform: translateY(-2px); }
.btn-discord {
  background: #5865f2; color: #fff;
  box-shadow: 0 10px 30px -12px rgba(88,101,242,.7);
}
.btn-discord:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 30px; font-size: 15.5px; }
.btn-danger { background: rgba(255,46,67,.12); border: 1px solid rgba(255,46,67,.4); color: var(--red-soft); }
.btn-danger:hover { background: rgba(255,46,67,.2); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---- Navbar -------------------------------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: height .3s var(--ease), background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  height: 60px;
  background: rgba(8,8,12,.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nav-logo {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px;
  letter-spacing: -.02em;
}
.nav-logo img { width: 30px; height: 30px; border-radius: 8px; }
.nav-logo .dot { color: var(--red); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  font-size: 14px; font-weight: 500;
  color: var(--text-dim);
  padding: 8px 14px; border-radius: 8px;
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255,255,255,.05); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-actions .btn { padding: 9px 18px; }
.nav-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--border-2);
  transition: border-color .2s, transform .2s;
}
.nav-avatar:hover { border-color: var(--red); transform: scale(1.05); }
.nav-burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }

/* mobile menu */
.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 99;
  background: rgba(10,10,16,.98);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 26px 50px -22px rgba(0,0,0,.75);
  padding: 12px 14px 18px;
  display: none; flex-direction: column; gap: 2px;
  max-height: calc(100dvh - var(--nav-h)); overflow-y: auto;
  transform: translateY(-12px); opacity: 0;
  transition: transform .3s var(--ease), opacity .3s;
}
.mobile-menu.open { display: flex; transform: translateY(0); opacity: 1; }

/* nav links render as rounded, tappable rows */
.mobile-menu a:not(.btn) {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px; border-radius: 11px;
  font-family: var(--font-display); font-size: 15.5px; font-weight: 500;
  color: var(--text-dim);
  transition: background .18s, color .18s;
}
.mobile-menu a:not(.btn)::after {
  content: ""; width: 7px; height: 7px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); opacity: .35;
}
.mobile-menu a:not(.btn):hover,
.mobile-menu a:not(.btn):active { background: rgba(255,255,255,.06); color: var(--text); }

/* auth block: divider + proper vertical stack (fixes inline run-on links) */
.mobile-menu #mobileAuth {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 8px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.mobile-menu #mobileAuth .btn { margin-top: 6px; }
.mobile-menu #mobileAuth a[href*="logout"] { color: var(--red-soft); }
.mobile-menu #mobileAuth a[href*="logout"]:hover { background: rgba(255,46,67,.1); }

/* ---- Hero ---------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 60px) 0 90px;
  overflow: hidden;
}
/* ---- Site background ----------------------------------------
   Layered, restrained dark system (injected by script.js):
   aurora top-light -> dot grid -> film grain -> edge vignette.   */
.bg-fx {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
}
.bg-fx > div { position: absolute; }

/* 1. aurora - soft red/purple light bleeding down from the top */
.bg-aurora {
  top: -28%; left: -15%; right: -15%; height: 100vh;
  background:
    radial-gradient(42% 54% at 27% 0%, rgba(255,46,67,.34), transparent 72%),
    radial-gradient(46% 58% at 75% 7%, rgba(139,61,245,.36), transparent 74%);
  filter: blur(55px);
  will-change: transform, opacity;
  animation: auroraDrift 22s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0%   { transform: translate3d(-3%, 0, 0) scale(1);   opacity: .72; }
  100% { transform: translate3d(4%, 2%, 0) scale(1.1); opacity: 1; }
}

/* 2. fine dot grid - structure near the top, fades out below */
.bg-grid {
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.5px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 92% 62% at 50% -6%, #000 22%, transparent 80%);
  mask-image: radial-gradient(ellipse 92% 62% at 50% -6%, #000 22%, transparent 80%);
}

/* 3. film grain - kills gradient banding, adds tactile depth */
.bg-grain {
  inset: 0; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 4. vignette - gently darkens the edges to focus content */
.bg-vignette {
  inset: 0;
  background: radial-gradient(ellipse 80% 74% at 50% 34%, transparent 50%, rgba(0,0,0,.55));
}

.hero-inner { max-width: 900px; margin: 0 auto; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px; border-radius: 99px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-2);
  font-size: 12.5px; font-weight: 500; color: var(--text-dim);
  margin-bottom: 26px;
}
.hero-badge .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 0 rgba(255,46,67,.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,46,67,.55); }
  70%  { box-shadow: 0 0 0 11px rgba(255,46,67,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,46,67,0); }
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 7.2vw, 86px);
  font-weight: 700; line-height: 1.02;
  letter-spacing: -.035em;
  margin-bottom: 22px;
}
.hero h1 .line { display: block; }
.hero p.lead {
  font-size: clamp(15px, 2vw, 19px);
  color: var(--text-dim);
  max-width: 600px; margin: 0 auto 36px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.hero-stats {
  display: flex; gap: 38px; margin-top: 56px; flex-wrap: wrap; justify-content: center;
}
.hero-stat .num {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stat .lbl { font-size: 12.5px; color: var(--text-mute); letter-spacing: .04em; }

.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-mute);
}
.hint-inner { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.hint-mobile { display: none; }
.scroll-hint .mouse {
  width: 22px; height: 34px; border: 1.5px solid var(--border-2); border-radius: 12px;
  display: flex; justify-content: center; padding-top: 6px;
}
.scroll-hint .mouse::before {
  content: ""; width: 3px; height: 7px; border-radius: 2px;
  background: var(--red-soft); animation: wheel 1.7s infinite;
}
@keyframes wheel { 0%{opacity:1;transform:translateY(0);} 70%{opacity:0;transform:translateY(9px);} 100%{opacity:0;} }

/* swipe indicator (mobile) - an upward-flicking touch dot */
.scroll-hint .swipe {
  width: 34px; height: 34px; border: 1.5px solid var(--border-2); border-radius: 50%;
  display: flex; justify-content: center; align-items: flex-end; padding-bottom: 6px;
}
.scroll-hint .swipe::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red-soft); animation: swipeup 1.7s infinite;
}
@keyframes swipeup {
  0%   { opacity: 0; transform: translateY(8px); }
  35%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-9px); }
}

/* ---- Category cards ----------------------------------------- */
.cat-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(3, 1fr);
}
.cat-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .3s, background .3s;
}
.cat-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(260px circle at var(--mx,50%) var(--my,50%), rgba(168,85,247,.2), transparent 60%);
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.cat-card:hover { transform: translateY(-6px); border-color: var(--border-2); }
.cat-card:hover::after { opacity: 1; }
.cat-icon {
  width: 52px; height: 52px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-soft);
  border: 1px solid var(--border-2);
  color: var(--red-soft);
  margin-bottom: 18px;
}
.cat-icon svg { width: 24px; height: 24px; }
.cat-card h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.cat-card p { font-size: 13.5px; color: var(--text-dim); margin-bottom: 16px; }
.cat-card .cat-count {
  position: relative;
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  color: var(--red-soft);
  display: inline-flex; align-items: center; gap: 6px;
}
.cat-card .cat-count svg { width: 14px; height: 14px; transition: transform .25s; }
.cat-card:hover .cat-count svg { transform: translateX(4px); }

/* ---- Project card grid -------------------------------------- */
.proj-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(3, 1fr);
}
.proj-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.proj-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
}
.proj-card:hover {
  transform: translateY(-7px);
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}
.proj-card::before {
  content: ""; position: absolute; inset: 0; z-index: 3;
  border-radius: inherit; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx,50%) var(--my,50%), rgba(255,46,67,.14), transparent 62%);
  opacity: 0; transition: opacity .35s;
}
.proj-card:hover::before { opacity: 1; }
.proj-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #15151f, #0d0d14);
}
.proj-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .55s var(--ease);
}
.proj-card:hover .proj-thumb img { transform: scale(1.07); }
.proj-thumb .ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.14);
}
.proj-thumb .ph svg { width: 64px; height: 64px; }

.proj-badges {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; justify-content: space-between; pointer-events: none;
}
.badge {
  font-family: var(--font-display);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 7px;
  backdrop-filter: blur(8px);
}
.badge-cat { background: rgba(10,10,16,.78); color: var(--text-dim); border: 1px solid var(--border-2); }
.badge-new { background: var(--grad); color: #fff; }
.badge-featured {
  background: rgba(10,10,16,.78); color: var(--purple-soft);
  border: 1px solid rgba(168,85,247,.4);
  display: inline-flex; align-items: center; gap: 5px;
}
.badge-featured svg { width: 11px; height: 11px; }

.proj-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.proj-body h3 {
  font-family: var(--font-display);
  font-size: 16.5px; font-weight: 600;
  margin-bottom: 6px; line-height: 1.3;
}
.proj-body p { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; flex: 1; }
.proj-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 13px; border-top: 1px solid var(--border);
}
.proj-price { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.proj-price.free { color: var(--red-soft); }
.proj-meta { font-size: 12px; color: var(--text-mute); display: inline-flex; align-items: center; gap: 5px; }
.proj-meta svg { width: 13px; height: 13px; }
.proj-card .card-link { position: absolute; inset: 0; z-index: 2; }

/* ---- Filter bar --------------------------------------------- */
.filter-bar {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; margin-bottom: 34px;
}
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font-size: 13px; font-weight: 500;
  padding: 9px 16px; border-radius: 99px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: all .2s;
}
.pill:hover { color: var(--text); border-color: var(--border-2); }
.pill.active { background: var(--grad); color: #fff; border-color: transparent; }
.search-box {
  position: relative; margin-left: auto;
}
.search-box svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-mute);
}
.search-box input {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px 11px 40px;
  color: var(--text); width: 240px;
  transition: border-color .2s, background .2s;
}
.search-box input:focus { outline: none; border-color: var(--purple); background: rgba(255,255,255,.06); }
.search-box input::placeholder { color: var(--text-mute); }

/* ---- Empty state -------------------------------------------- */
.empty {
  text-align: center;
  padding: 70px 24px;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.015);
}
.empty .empty-ic {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-soft);
  color: var(--red-soft);
}
.empty .empty-ic svg { width: 30px; height: 30px; }
.empty h3 { font-family: var(--font-display); font-size: 19px; margin-bottom: 8px; }
.empty p { color: var(--text-dim); font-size: 14px; max-width: 380px; margin: 0 auto; }

/* ---- Footer -------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 34px;
  margin-top: 40px;
  background: rgba(0,0,0,.3);
}
.footer-top {
  display: flex; justify-content: space-between; gap: 40px;
  flex-wrap: wrap; margin-bottom: 40px;
}
.footer-brand { max-width: 320px; }
.footer-brand .nav-logo { margin-bottom: 14px; }
.footer-brand p { font-size: 13.5px; color: var(--text-dim); }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-mute); margin-bottom: 14px;
}
.footer-col a { display: block; font-size: 14px; color: var(--text-dim); padding: 5px 0; transition: color .2s; }
.footer-col a:hover { color: var(--red-soft); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; flex-wrap: wrap;
  padding-top: 26px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-mute);
}
.socials { display: flex; gap: 10px; }
.socials a {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: transform .25s var(--ease), border-color .25s, background .25s, color .25s;
}
.socials a:hover {
  transform: translateY(-3px); border-color: var(--border-2);
  background: var(--grad-soft); color: #fff;
}
.socials img, .socials svg { width: 18px; height: 18px; }

/* ---- Reveal animation --------------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .bg-aurora, .scroll-hint .mouse::before, .scroll-hint .swipe::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---- Page header (sub-pages) -------------------------------- */
.page-head {
  padding: calc(var(--nav-h) + 56px) 0 30px;
  position: relative;
}
.crumbs { font-size: 13px; color: var(--text-mute); margin-bottom: 16px; }
.crumbs a:hover { color: var(--red-soft); }
.crumbs span { margin: 0 7px; }
.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 700; letter-spacing: -.03em; line-height: 1.05;
}
.page-head p.sub { color: var(--text-dim); margin-top: 12px; max-width: 560px; }

/* ---- Auth card (login) -------------------------------------- */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--nav-h) + 40px) 24px 60px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow);
}
.auth-card::before {
  content: ""; position: absolute; inset: -1px;
  border-radius: inherit; padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .4; pointer-events: none;
}
.auth-logo {
  width: 56px; height: 56px; border-radius: 14px;
  margin: 0 auto 20px;
}
.auth-card h1 { font-family: var(--font-display); font-size: 24px; margin-bottom: 8px; }
.auth-card .auth-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 28px; }
.auth-note { font-size: 12.5px; color: var(--text-mute); margin-top: 22px; line-height: 1.6; }
.auth-error {
  background: rgba(255,46,67,.1);
  border: 1px solid rgba(255,46,67,.35);
  color: var(--red-soft);
  font-size: 13px; padding: 11px 14px;
  border-radius: 10px; margin-bottom: 20px;
}

/* ---- Profile ------------------------------------------------ */
.profile-hero {
  display: flex; align-items: center; gap: 22px;
  flex-wrap: wrap;
}
.profile-hero img.pf-avatar {
  width: 88px; height: 88px; border-radius: 22px;
  border: 2px solid var(--border-2);
}
.profile-hero h1 { font-family: var(--font-display); font-size: clamp(26px,4vw,38px); }
.profile-hero .pf-meta { color: var(--text-mute); font-size: 13.5px; margin-top: 4px; }
.pf-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 7px; margin-top: 8px;
}
.pf-tag.admin { background: var(--grad); color: #fff; }
.pf-tag.member { background: rgba(255,255,255,.05); border: 1px solid var(--border-2); color: var(--text-dim); }

/* ---- Project detail ----------------------------------------- */
.detail-grid {
  display: grid; grid-template-columns: 1.7fr 1fr; gap: 40px;
  align-items: start;
}
.detail-media {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(135deg,#15151f,#0d0d14);
  aspect-ratio: 16/9;
}
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-media .ph { display:flex;align-items:center;justify-content:center;height:100%;color:rgba(255,255,255,.12); }
.detail-media .ph svg { width: 90px; height: 90px; }
.gallery-strip { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-strip img {
  width: 90px; height: 60px; object-fit: cover;
  border-radius: 9px; border: 1px solid var(--border);
  cursor: pointer; transition: border-color .2s, transform .2s;
}
.gallery-strip img:hover { border-color: var(--red); transform: translateY(-2px); }
.detail-desc { margin-top: 28px; }
.detail-desc h2 { font-family: var(--font-display); font-size: 20px; margin-bottom: 12px; }
.detail-desc p { color: var(--text-dim); margin-bottom: 12px; }

.detail-side {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  position: sticky; top: 88px;
}
.detail-side .price-row {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px;
}
.detail-side .price-big {
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.detail-side .price-sub { font-size: 13px; color: var(--text-mute); margin-bottom: 20px; }
.spec-list { margin: 22px 0; }
.spec-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.spec-list li span:first-child { color: var(--text-mute); }
.spec-list li span:last-child { color: var(--text); font-weight: 500; text-align: right; }
.tag-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.tag {
  font-size: 11.5px; padding: 4px 10px; border-radius: 6px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  color: var(--text-dim);
}

/* ---- Library list (profile) --------------------------------- */
.lib-list { display: flex; flex-direction: column; gap: 12px; }
.lib-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: border-color .25s, transform .25s var(--ease);
}
.lib-row:hover { border-color: var(--border-2); transform: translateX(4px); }
.lib-thumb {
  width: 72px; height: 50px; border-radius: 9px; object-fit: cover;
  background: linear-gradient(135deg,#15151f,#0d0d14);
  flex-shrink: 0;
}
.lib-info { flex: 1; min-width: 0; }
.lib-info h4 { font-family: var(--font-display); font-size: 15px; }
.lib-info .lib-sub { font-size: 12.5px; color: var(--text-mute); }

/* ---- Admin -------------------------------------------------- */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; gap: 28px; align-items: start; }
.admin-side {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  position: sticky; top: 88px;
}
.admin-side button, .admin-side a {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 13px; border-radius: 9px; font-size: 14px; font-weight: 500;
  color: var(--text-dim); text-align: left; transition: all .2s;
}
.admin-side button:hover, .admin-side a:hover { background: rgba(255,255,255,.05); color: var(--text); }
.admin-side button.active { background: var(--grad-soft); color: var(--text); }
.admin-side svg { width: 17px; height: 17px; }

.stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 26px; }
.stat-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.stat-box .s-num { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.stat-box .s-lbl { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

.admin-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left; font-family: var(--font-display);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-mute); padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 13px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.admin-table tr:hover td { background: rgba(255,255,255,.02); }
.admin-table .t-thumb { width: 52px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--bg-2); }
.row-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  color: var(--text-dim); transition: all .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.icon-btn.del:hover { color: var(--red-soft); border-color: rgba(255,46,67,.4); }
.icon-btn svg { width: 15px; height: 15px; }

.status-chip {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px;
  font-family: var(--font-display);
}
.status-chip.published { background: rgba(74,222,128,.12); color: #6ee7a8; }
.status-chip.draft { background: rgba(255,255,255,.06); color: var(--text-mute); }

/* ---- Forms -------------------------------------------------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 7px; color: var(--text-dim);
}
.field label .hint { color: var(--text-mute); font-weight: 400; }
.field input[type=text], .field input[type=url], .field input[type=number],
.field textarea, .field select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--text);
  transition: border-color .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--purple); background-color: var(--surface);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check-row { display: flex; align-items: center; gap: 9px; }
.check-row label { margin: 0; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 11px; padding: 13px 20px; font-size: 14px;
  box-shadow: var(--shadow); z-index: 200;
  opacity: 0; transition: opacity .3s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-left: 3px solid #6ee7a8; }
.toast.err { border-left: 3px solid var(--red); }

/* modal */
.modal-bg {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(4,4,8,.78); backdrop-filter: blur(6px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 60px 20px; overflow-y: auto;
}
.modal-bg.open { display: flex; }
.modal {
  width: 100%; max-width: 620px;
  background: var(--bg-1); border: 1px solid var(--border-2);
  border-radius: var(--radius-lg); padding: 28px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.modal-head h2 { font-family: var(--font-display); font-size: 21px; }

.loader {
  width: 30px; height: 30px; margin: 50px auto;
  border: 3px solid var(--border-2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Responsive --------------------------------------------- */
@media (max-width: 980px) {
  .cat-grid { grid-template-columns: repeat(2,1fr); }
  .proj-grid, .proj-grid.cols-4 { grid-template-columns: repeat(2,1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; display: flex; flex-wrap: wrap; gap: 8px; }
  .admin-side button, .admin-side a { width: auto; white-space: nowrap; flex: 1 1 auto; }
  .stat-row { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 720px) {
  .nav-links, .nav-actions .btn, .nav-actions .nav-avatar { display: none; }
  .nav-burger { display: flex; }
  .nav-actions { display: flex; }
  .wrap { padding: 0 20px; }
  .section { padding: 70px 0; }
  .cat-grid { grid-template-columns: 1fr; }
  .proj-grid, .proj-grid.cols-4 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .search-box { margin-left: 0; width: 100%; }
  .search-box input { width: 100%; }
  .hero-stats { gap: 26px; }
  .footer-top { flex-direction: column; gap: 30px; }
  .about-grid { grid-template-columns: 1fr !important; gap: 30px !important; }
}

/* ============================================================
   v2 - dashboard, badges, profiles, effects
   ============================================================ */

/* ---- Cursor glow -------------------------------------------- */
.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,46,67,.11), rgba(168,85,247,.08) 42%, transparent 70%);
  pointer-events: none; z-index: -1;
  opacity: 0; transition: opacity .55s; will-change: transform;
}
.cursor-glow.on { opacity: 1; }

/* ---- Nav extra link ----------------------------------------- */
.nav-links-extra {
  font-size: 13px; font-weight: 600; color: var(--red-soft);
  padding: 8px 13px; border-radius: 8px; transition: background .2s;
}
.nav-links-extra:hover { background: rgba(255,46,67,.1); }

/* ---- User badges -------------------------------------------- */
.ubadge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; font-family: var(--font-display);
  background: color-mix(in srgb, var(--bc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--bc) 42%, transparent);
  color: var(--bc); white-space: nowrap; vertical-align: middle;
}
.ubadge svg { width: 13px; height: 13px; }
.ubadge.small { font-size: 10.5px; padding: 3px 8px 3px 6px; }
.ubadge.small svg { width: 11px; height: 11px; }
.ubadge.icon-only { padding: 5px; }
.ubadge.icon-only svg { width: 14px; height: 14px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 7px; }

/* ---- Toggle switch ------------------------------------------ */
.switch { position: relative; display: inline-block; width: 44px; height: 25px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: 99px; transition: .25s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 17px; width: 17px;
  left: 3px; top: 3px; border-radius: 50%;
  background: var(--text-mute); transition: .25s;
}
.switch input:checked + .slider { background: var(--grad); border-color: transparent; }
.switch input:checked + .slider::before { transform: translateX(19px); background: #fff; }

/* ---- Generic glass panel ------------------------------------ */
.glass-card {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.glass-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(300px circle at var(--mx,50%) var(--my,50%), rgba(168,85,247,.07), transparent 60%);
  opacity: 0; transition: opacity .4s;
}
.glass-card:hover::after { opacity: 1; }

/* ---- Dashboard panels --------------------------------------- */
.dash-panel { display: none; }
.dash-panel.active { display: block; animation: fadeUp .4s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap; margin-bottom: 20px;
}
.panel-head h2 { font-family: var(--font-display); font-size: 22px; }
.panel-head p { font-size: 13px; color: var(--text-mute); }
.side-count {
  margin-left: auto; background: var(--grad); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
}

/* ---- Metric cards ------------------------------------------- */
.metric-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
.metric {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.metric .m-ic {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-soft); color: var(--red-soft); margin-bottom: 13px;
}
.metric .m-ic svg { width: 19px; height: 19px; }
.metric .m-num { font-family: var(--font-display); font-size: 27px; font-weight: 700; line-height: 1; }
.metric .m-lbl { font-size: 12.5px; color: var(--text-mute); margin-top: 5px; }
.metric .m-trend { font-size: 11.5px; color: #6ee7a8; margin-top: 6px; font-weight: 500; }

/* ---- Charts ------------------------------------------------- */
.chart-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 160px; }
.bars .bar {
  flex: 1; background: var(--grad); border-radius: 4px 4px 0 0;
  min-height: 3px; position: relative; transition: height .7s var(--ease);
}
.bars .bar:hover { filter: brightness(1.2); }
.bars .bar:hover::after {
  content: attr(data-v); position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%); margin-bottom: 5px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 6px; padding: 2px 8px; font-size: 11px; white-space: nowrap;
}
.bars-x { display: flex; gap: 5px; margin-top: 8px; }
.bars-x span { flex: 1; text-align: center; font-size: 9px; color: var(--text-mute); }
.cat-bar { margin-bottom: 13px; }
.cat-bar:last-child { margin-bottom: 0; }
.cat-bar-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.cat-bar-top span:last-child { color: var(--text-mute); }
.cat-bar-track { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.cat-bar-fill { height: 100%; background: var(--grad); border-radius: 99px; transition: width .8s var(--ease); }

/* ---- Mini lists --------------------------------------------- */
.mini-list { display: flex; flex-direction: column; gap: 3px; }
.mini-row {
  display: flex; align-items: center; gap: 11px;
  padding: 9px; border-radius: 9px; transition: background .2s;
}
.mini-row:hover { background: rgba(255,255,255,.03); }
.mini-row img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.mini-row .mi-thumb { width: 46px; height: 32px; border-radius: 6px; object-fit: cover; background: var(--bg-2); }
.mini-row .mi-main { flex: 1; min-width: 0; }
.mini-row .mi-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row .mi-sub { font-size: 11.5px; color: var(--text-mute); }
.mini-row .mi-val { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--red-soft); }

/* ---- User management rows ----------------------------------- */
.user-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px; margin-bottom: 10px;
}
.user-row img.ur-av { width: 46px; height: 46px; border-radius: 50%; }
.user-row .ur-main { flex: 1; min-width: 0; }
.user-row .ur-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-row .ur-sub { font-size: 12.5px; color: var(--text-mute); }
.user-row.banned { opacity: .55; }

/* ---- Badge manager cards ------------------------------------ */
.badge-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.badge-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; position: relative;
}
.badge-card .bc-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.badge-card .bc-icon svg { width: 22px; height: 22px; }
.badge-card h4 { font-family: var(--font-display); font-size: 15.5px; margin-bottom: 4px; }
.badge-card p { font-size: 12.5px; color: var(--text-dim); margin-bottom: 12px; min-height: 32px; }
.badge-card .bc-foot { display: flex; align-items: center; justify-content: space-between; }
.preset-tag {
  font-size: 10px; font-weight: 700; font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 6px;
}
.preset-tag.visual { background: rgba(255,255,255,.06); color: var(--text-dim); }
.preset-tag.admin { background: rgba(255,46,67,.14); color: var(--red-soft); }
.preset-tag.distributor { background: rgba(168,85,247,.16); color: var(--purple-soft); }

/* ---- Verification cards ------------------------------------- */
.verif-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
}
.verif-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.verif-top img { width: 42px; height: 42px; border-radius: 50%; }
.verif-msg {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px;
  color: var(--text-dim); margin-bottom: 12px; white-space: pre-wrap;
}
.verif-links { font-size: 12.5px; margin-bottom: 12px; word-break: break-all; }
.verif-links a { color: var(--purple-soft); }

/* ---- Public profile ----------------------------------------- */
.count-row { display: flex; gap: 26px; margin-top: 12px; flex-wrap: wrap; }
.count-row .ct b {
  font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-right: 5px;
}
.count-row .ct span { font-size: 12.5px; color: var(--text-mute); }
.profile-bio { color: var(--text-dim); font-size: 14.5px; margin-top: 14px; max-width: 560px; }
.follow-btn.following {
  background: rgba(255,255,255,.05); border: 1px solid var(--border-2);
  color: var(--text); box-shadow: none;
}
.follow-btn.following:hover { border-color: rgba(255,46,67,.4); color: var(--red-soft); }
.private-note {
  text-align: center; padding: 40px 24px; color: var(--text-mute);
  border: 1px dashed var(--border-2); border-radius: var(--radius-lg); font-size: 14px;
}

/* ---- Studio / tabs ------------------------------------------ */
.studio-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.tab-strip {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 24px; flex-wrap: wrap;
}
.tab-strip button {
  padding: 11px 16px; font-size: 14px; font-weight: 500; color: var(--text-dim);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}
.tab-strip button:hover { color: var(--text); }
.tab-strip button.active { color: var(--text); border-bottom-color: var(--red); }

@media (max-width: 980px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .chart-row { grid-template-columns: 1fr; }
  .badge-grid { grid-template-columns: repeat(2,1fr); }
  .studio-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .badge-grid { grid-template-columns: 1fr; }
  .user-row { flex-wrap: wrap; }
  .cursor-glow { display: none; }
}

/* ============================================================
   Custom form controls - no native OS styling
   ============================================================ */
input[type=text], input[type=url], input[type=number], input[type=email],
input[type=search], input[type=password], textarea, select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  font-family: inherit;
}

/* selects: themed control + custom caret (no native dropdown arrow) */
select, .field select {
  background-color: var(--bg-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239a9aa8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
select:disabled { opacity: .55; cursor: not-allowed; }
select option { background: var(--surface); color: var(--text); }

/* number inputs: no spinner buttons */
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* search inputs: no native clear/decoration */
input[type=search]::-webkit-search-decoration,
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* checkboxes */
.check-row input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  width: 19px; height: 19px; border-radius: 6px; margin: 0;
  border: 1.5px solid var(--border-2); background: var(--bg-2);
  cursor: pointer; position: relative; flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.check-row input[type=checkbox]:hover { border-color: var(--purple); }
.check-row input[type=checkbox]:checked { background: var(--grad); border-color: transparent; }
.check-row input[type=checkbox]:checked::after {
  content: ""; position: absolute; left: 6px; top: 2.5px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* colour swatch palette (replaces the native colour picker) */
.swatch-row { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch {
  width: 32px; height: 32px; border-radius: 9px; padding: 0;
  border: 2px solid transparent; cursor: pointer; position: relative;
  transition: transform .15s;
}
.swatch:hover { transform: scale(1.13); }
.swatch.active::after {
  content: ""; position: absolute; inset: -5px;
  border: 2px solid #fff; border-radius: 12px;
}

/* ============================================================
   Mobile pass - phone-specific refinements
   ============================================================ */
@media (max-width: 720px) {
  /* hide the chunky themed scrollbar on phones (touch scroll) */
  ::-webkit-scrollbar { width: 0; height: 0; }

  /* the standalone "Admin" nav link is in the burger menu on mobile */
  .nav-links-extra { display: none; }

  /* hero hint: "Swipe" indicator instead of the desktop mouse */
  .hint-desktop { display: none; }
  .hint-mobile { display: flex; }

  /* profile header: stack avatar / info / actions cleanly */
  .profile-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .profile-hero > div { flex: none !important; width: 100%; }
  .profile-hero > div:last-child .btn { width: 100%; }
  .profile-hero img.pf-avatar { width: 76px; height: 76px; }

  /* tighter auth card */
  .auth-card { padding: 32px 22px; }

  /* modals use more of the screen */
  .modal-bg { padding: 40px 12px; }
  .modal { padding: 22px; }

  /* keep section heads with inline action buttons from colliding */
  .section-head { gap: 14px; }
}

@media (max-width: 460px) {
  .metric-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 22px 30px; }
  .count-row { gap: 18px; }
  .btn-lg { padding: 14px 22px; font-size: 14.5px; }
}

/* ============================================================
   Design polish pass - focus states, skeletons, tabular figures
   ============================================================ */

/* ---- Visible keyboard focus (a11y) -------------------------- */
/* outlines auto-follow each element's own border-radius */
a:focus-visible, button:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible,
.switch input:focus-visible + .slider {
  outline: 2px solid var(--purple-soft);
  outline-offset: 2px;
}
/* card-wide links: ring the whole card from the inside */
.card-link:focus-visible {
  outline: 2px solid var(--purple-soft);
  outline-offset: -3px;
}
.proj-card:focus-within { border-color: var(--border-2); }

/* ---- Tabular figures for all numeric displays --------------- */
.hero-stat .num, .metric .m-num, .stat-box .s-num, .count-row .ct b,
.proj-price, .proj-meta, .mini-row .mi-val, .bars .bar,
.detail-side .price-big, .spec-list li span:last-child {
  font-variant-numeric: tabular-nums;
}

/* ---- Skeleton loading states -------------------------------- */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--card-2);
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.055), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.skel-grid { display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
.skel-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--card);
}
.skel-card .skel-thumb { aspect-ratio: 16 / 10; }
.skel-card .skel-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.skel-line { height: 11px; border-radius: 6px; }
.skel-line.lg { height: 15px; }
.skel-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.skel-row .skel-av { width: 72px; height: 50px; border-radius: 9px; flex-shrink: 0; }
.skel-row .skel-rl { flex: 1; display: flex; flex-direction: column; gap: 9px; }

@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }
@media (max-width: 980px) { .skel-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .skel-grid { grid-template-columns: 1fr; } }

/* ---- Drag & drop upload zone -------------------------------- */
.dropzone {
  position: relative; overflow: hidden;
  border: 1.5px dashed var(--border-2); border-radius: 12px;
  padding: 18px 14px; text-align: center; cursor: pointer;
  background: var(--bg-2);
  transition: border-color .2s, background .2s;
}
.dropzone:hover { border-color: var(--purple); background: var(--surface); }
.dropzone.drag { border-color: var(--purple); border-style: solid; background: var(--surface); }
.dropzone.done { border-color: rgba(110,231,168,.5); border-style: solid; }
.dropzone.uploading { cursor: progress; }
.dropzone .dz-ic { width: 28px; height: 28px; margin: 0 auto 7px; color: var(--text-mute); }
.dropzone .dz-ic svg { width: 100%; height: 100%; }
.dropzone .dz-text { font-size: 12.5px; color: var(--text-dim); }
.dropzone .dz-text b { color: var(--red-soft); font-weight: 600; }
.dropzone .dz-status { font-size: 12px; margin-top: 6px; min-height: 15px; color: var(--text-mute); }
.dropzone .dz-status.ok { color: #6ee7a8; }
.dropzone .dz-status.err { color: var(--red-soft); }
.dropzone .dz-preview {
  display: none; max-height: 96px; border-radius: 8px;
  margin: 10px auto 0; border: 1px solid var(--border);
}
.dropzone::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px;
  width: var(--prog, 0%); background: var(--grad);
  transition: width .25s; opacity: 0;
}
.dropzone.uploading::after, .dropzone.done::after { opacity: 1; }

/* ============================================================
   No horizontal overflow - portrait/vertical hardening
   ============================================================ */
html, body { max-width: 100%; }
body { overflow-wrap: break-word; }
/* long unbreakable strings (filenames, urls, slugs) must wrap */
.dz-status, .verif-links, .crumbs, .lib-sub, .ur-sub, .mi-sub,
.proj-body p, .detail-desc, .profile-bio { overflow-wrap: anywhere; }
/* media never pushes width */
img, svg, video, canvas { max-width: 100%; }

/* admin projects table -> stacked cards on phones (no inner scroll) */
@media (max-width: 720px) {
  .admin-card { padding: 14px; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table thead { display: none; }
  .admin-table tr {
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px; margin-bottom: 10px;
  }
  .admin-table tr:hover td { background: transparent; }
  .admin-table td { border: none; padding: 4px 0; }
  .admin-table td:first-child { padding: 0 0 10px; }
  .admin-table td:first-child .t-thumb { width: 100%; height: 120px; }
  .admin-table td[data-label] {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
  }
  .admin-table td[data-label]::before {
    content: attr(data-label);
    font-family: var(--font-display); font-size: 10.5px; font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute);
  }
  .admin-table td[data-label="Actions"] { padding-top: 10px; }
  /* card grids never sit side-by-side too tight */
  .stat-row { grid-template-columns: 1fr; }
}
