/* 
Rarecanvas — visual identity
   Palette recovers the violet accent from the site's own original
   auth pages (#6b46ff) instead of a generic SaaS blue. Ink is warm
   near-black, not flat #000; surfaces lean warm-neutral, not cold
   gray — a gallery-wall feel rather than a dashboard feel. */

@font-face {
  font-family: 'CircularXX';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../CircularXXWeb-Book-cd7d2bcec649b1243839a15d5eb8f0a3.woff2') format('woff2');
}
@font-face {
  font-family: 'CircularXX';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('../CircularXXWeb-Medium-d74eac43c78bd5852478998ce63dceb3.woff2') format('woff2');
}
@font-face {
  font-family: 'CircularXX';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('../CircularXXWeb-Bold-83b8ceaf77f49c7cffa44107561909e4.woff2') format('woff2');
}
@font-face {
  font-family: 'CircularXX';
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  src: url('../CircularXXWeb-Black-bf067ecb8aa777ceb6df7d72226febca.woff2') format('woff2');
}

:root {
  --bg: #0e1013;
  --surface: #101317;
  --card-bg: #121418;
  --elev: #1a1c20;
  --border: #23262b;
  --ink: #e7e8ea;
  --text: #e7e8ea;
  --muted: #9aa0a6;

  --accent: #262ff8;
  --accent-ink: #1c24d1;
  --accent-soft: #161a3d;
  /* Lighter tint used specifically where the accent renders as TEXT
     directly on the dark page background (eyebrows, link hovers) — the
     saturated --accent reads great as a button fill under white text,
     but at ~2.7:1 it fails text contrast on its own against --bg. This
     variant holds ~7:1 against --bg. */
  --accent-text: #8b93ff;
  /* legacy alias so any un-swept var(--primary*) still resolves correctly */
  --primary: #262ff8;
  --primary-600: #1c24d1;
  --ring: rgba(38,47,248,0.25);

  --radius: 14px;
  --radius-lg: 22px;
  --container: 1240px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 12px 32px rgba(0,0,0,.5);

  --success: #86e0a6;
  --success-bg: rgba(34,197,94,0.12);
  --warning: #fbbf24;
  --warning-bg: rgba(245,158,11,0.12);
  --danger: #f19999;
  --danger-bg: rgba(239,68,68,0.12);
}

/* min-width:0 overrides the browser default of min-width:auto on flex/grid
   items, which otherwise refuses to shrink below its content's intrinsic
   size and silently forces rows wider than the viewport on small screens. */
* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'CircularXX', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent-text); }
img { max-width: 100%; height: auto; display: block; border-radius: calc(var(--radius) - 4px); }
hr { border: 0; border-top: 1px solid var(--border); }
h1, h2, h3 { font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }

/* Editorial display serif — used for the hero headline and section
   titles, paired against the geometric CircularXX body text for a
   gallery/curatorial contrast rather than a single-typeface look. */
h1, .section-header h2, .hero h1 { font-family: 'Fraunces', 'CircularXX', serif; font-optical-sizing: auto; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* Eyebrow — small structural label used above section headers/hero to
   name what the reader is looking at (Featured, Trending, etc). */
.eyebrow { display: block; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 10px; }

/* Gradient-fill text — a spotlighted word within a headline, à la the
   colorful headline treatments on protocol-native NFT platforms. */
.text-accent-gradient {
  background: linear-gradient(100deg, var(--accent-text) 10%, #a98cff 55%, #ff6fae 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* Grain — a faint film-grain texture for hero/gallery surfaces, applied
   as a repeating noise tile at very low opacity. Decorative only:
   absolutely positioned, non-interactive. */
.grain::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Section divider — a small curatorial ornament between major sections,
   replacing a plain stacked-sections rhythm. */
.section-divider { display: flex; align-items: center; gap: 14px; margin: 8px 0 32px; color: var(--muted); }
.section-divider::before, .section-divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--border) 50%, transparent); }
.section-divider span { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; }
.section-divider span::before { content: '◆'; color: var(--accent-text); margin-right: 8px; font-size: 8px; vertical-align: middle; }

/* Navbar */
.navbar { position: sticky; top: 0; z-index: 1000; background: rgba(14,16,19,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; color: var(--ink); }
.brand-mark { color: var(--accent-text); }
.nav-logout-link { color: var(--danger) !important; }
.nav-logout-link:hover { opacity: .8; }
.brand-text { font-size: 19px; }
.nav-links { display: flex; gap: 4px; align-items: center; }

/* Compact header — public/front pages only (index, explore, buy,
   category, contact, login, register, public profile). A tighter,
   app-style single row: hamburger, wordmark, search icon, primary CTA.
   The dashboard/account pages keep the existing .nav-inner header
   entirely untouched. */
.nav-inner-compact { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand-compact { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; color: var(--ink); }
.brand-compact img { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; }
.brand-compact span { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn { background: none; border: 0; color: var(--text); cursor: pointer; padding: 6px; display: flex; align-items: center; border-radius: 8px; }
.icon-btn:hover { background: var(--elev); }

/* Front-page compact header: search icon reveals this bar instead of a
   permanently-visible input (removed earlier per site owner's request). */
.compact-search-bar { background: var(--bg); border-bottom: 1px solid var(--border); }
.compact-search-bar__inner { display: flex; gap: .5rem; align-items: center; padding: .6rem 0; }
.compact-search-bar .search-suggest-wrap { flex: 1 1 auto; min-width: 0; }
.compact-search-bar input { width: 100%; padding: .65rem .8rem; border-radius: 10px; border: 1px solid var(--border); background: var(--elev); color: var(--text); font: inherit; }
.compact-search-bar .btn { flex: 0 0 auto; }
.nav-profile-strip { display: none; } /* mobile-drawer only, see @media 768px */
/* .nav-backdrop's visibility is controlled entirely by the `hidden`
   attribute (toggled in site.js) — no display rule here, so removing
   `hidden` correctly falls through to the div's default display:block. */
.nav-links a { color: var(--muted); padding: 10px 12px; border-radius: 8px; font-size: 14.5px; font-weight: 500; position: relative; }
.nav-links a:hover { color: var(--ink); }
.nav-search { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.nav-search .search-suggest-wrap { position: relative; flex: 1 1 auto; min-width: 230px; }
.nav-search input { background: var(--elev); color: var(--text); border: 1px solid transparent; border-radius: 10px; height: 40px; padding: 0 14px; width: 100%; font: inherit; }
.nav-search input:focus { outline: none; border-color: var(--accent); background: var(--card-bg); box-shadow: 0 0 0 3px var(--ring); }

/* Artist search suggestions dropdown (nav-search + mobile-top-search) */
.search-suggest-wrap { position: relative; }
.search-suggestions { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); z-index: 30; overflow: hidden; max-height: 320px; overflow-y: auto; }
.search-suggest-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--ink); text-decoration: none; }
.search-suggest-item:hover, .search-suggest-item.active { background: var(--elev); }
.search-suggest-item img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--elev); }
.search-suggest-item .ssi-text { display: flex; flex-direction: column; min-width: 0; }
.search-suggest-item .ssi-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.search-suggest-item .ssi-email { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-suggest-empty { padding: 12px; font-size: 13px; color: var(--muted); }

/* Language switcher (Google Website Translator, custom-styled — its own
   default banner/gadget UI is hidden below). */
.lang-switcher select#lang-select { background: var(--card-bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.lang-switcher select#lang-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
body { top: 0 !important; } /* Google injects this on <html>/<body> when its banner shows */
.goog-te-banner-frame, iframe.skiptranslate, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
.goog-te-gadget { height: 0 !important; overflow: hidden !important; }
#google_translate_element { display: none !important; }
.nav-toggle { display: none; background: transparent; color: var(--ink); border: none; font-size: 22px; cursor: pointer; line-height: 1; padding: 6px; }

.btn { background: var(--card-bg); color: var(--ink); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; cursor: pointer; font: inherit; font-weight: 600; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff !important; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff !important; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: var(--card-bg); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }

/* Dropdown (header "More"/"Account" menus) */
.nav-links .has-children { position: relative; }
.nav-links .parent-row { display: flex; align-items: center; }
.nav-links .submenu-toggle { display: none; background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 4px; }
/* right-anchored, not left: these triggers sit toward the right end of
   the nav, so a left-anchored panel would run past the viewport edge. */
.nav-links .submenu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; max-width: calc(100vw - 32px); background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: .5rem; display: none; z-index: 20; box-shadow: var(--shadow-md); }
.nav-links .submenu a { display: block; padding: .55rem .7rem; border-radius: 8px; white-space: nowrap; color: var(--ink); font-size: 14px; font-weight: 500; }
.nav-links .submenu a:hover { background: var(--elev); color: var(--ink); }
.nav-links .submenu-divider { border: 0; border-top: 1px solid var(--border); margin: .4rem .2rem; }
@media (min-width: 769px) { .nav-links .has-children:hover > .submenu { display: block; } }

/* Brand wordmark */
.brand-text--nons {
  font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-transform: lowercase;
}
.brand-text--nons::first-letter { text-transform: uppercase; }

/* Search results panel */
.search-results.container { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 1rem; padding: 1rem 0; }
.results-col h3 { margin: 0 0 .5rem; }
.results-col ul { list-style: none; padding: 0; margin: 0; }
.results-col li a { color: var(--muted); }
.results-col li a:hover { color: var(--accent-text); }

/* Mobile top search */
.mobile-top-search { display: none; background: var(--bg); border-bottom: 1px solid var(--border); }
.mobile-top-search__inner { display: flex; gap: .5rem; align-items: center; padding: .6rem 0; }
.mobile-top-search .search-suggest-wrap { flex: 1 1 auto; min-width: 0; }
.mobile-top-search input { width: 100%; padding: .65rem .8rem; border-radius: 10px; border: 1px solid var(--border); background: var(--elev); color: var(--text); font: inherit; }
.mobile-top-search .btn { flex: 0 0 auto; }

/* Search results */
.search-results { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px; padding: 16px 0; }
.search-results h3 { color: var(--text); font-size: 14px; margin-bottom: 8px; }
.search-results ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.search-results li a { color: var(--muted); }
.search-results li a:hover { color: var(--accent-text); }
.muted { color: var(--muted); }

/* Hero — also used as a plain page-title header on category/collection/
   profile/offers pages, so this stays a simple block with no decoration. */
.hero { padding: 72px 0 16px; position: relative; }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.6vw, 80px); font-weight: 900; line-height: .98; letter-spacing: -.02em; margin: 0 0 18px; }
.hero p { color: var(--muted); margin: 0 0 26px; font-size: 17px; max-width: 46ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-card { background: linear-gradient(160deg, var(--accent-soft) 0%, var(--card-bg) 62%); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }

/* Category pills — horizontal scrollable filter row above the hero
   carousel (front pages only). */
.category-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -ms-overflow-style: none; scrollbar-width: none; }
.category-pills::-webkit-scrollbar { display: none; }
.pill-chip { flex-shrink: 0; padding: 8px 16px; border-radius: 999px; background: var(--card-bg); border: 1px solid var(--border); color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.pill-chip:hover { color: var(--text); border-color: var(--accent-text); }
.pill-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Featured collections carousel — full-width card per slide, image with
   a bottom gradient overlay carrying the name/creator/stats, matching
   the marketplace-app reference (front pages only). */
.featured-carousel { position: relative; width: 100%; aspect-ratio: 4/5; max-height: 640px; border-radius: var(--radius-lg); overflow: hidden; background: var(--elev); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.featured-carousel .slider-track { display: flex; width: 100%; height: 100%; transition: transform .55s ease; }
.featured-slide { position: relative; flex: 0 0 100%; width: 100%; height: 100%; display: block; }
.featured-slide img, .featured-slide video { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 20px 84px; background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.55) 45%, transparent 100%); color: #fff; }
.featured-title { font-family: 'Fraunces', 'CircularXX', serif; font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.featured-creator { font-size: 14px; opacity: .8; margin-top: 4px; }
.featured-stats { position: absolute; left: 20px; right: 20px; bottom: 20px; display: flex; justify-content: space-between; gap: 12px; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); border-radius: 12px; padding: 12px 16px; }
.featured-stat-label { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.featured-stat-value { display: block; font-size: 15px; font-weight: 700; margin-top: 2px; }
@media (max-width: 640px) { .featured-carousel { aspect-ratio: 3/4; } .featured-title { font-size: 20px; } }

/* Sections */
.section { padding: 56px 0; }
.section-alt { background: var(--surface); }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.section h2 { font-size: clamp(22px, 2.4vw, 30px); margin: 0; letter-spacing: -.01em; }

/* Grid & cards */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1024px){ .grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; } }
@media (max-width: 640px){ .grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; } }
@media (max-width: 420px){ .grid { grid-template-columns: 1fr; } }

.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: clip; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; box-shadow: var(--shadow-sm); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md), 0 0 0 1px rgba(38,47,248,.18), 0 10px 28px rgba(38,47,248,.14); border-color: color-mix(in oklab, var(--accent) 45%, var(--border) 55%); }
.card-media { aspect-ratio: 1 / 1; background: var(--elev); overflow: hidden; }
.card-media img, .card-media video { transition: transform .4s ease; }
.card:hover .card-media img, .card:hover .card-media video { transform: scale(1.045); }
@media (prefers-reduced-motion: reduce) { .card, .card-media img, .card-media video { transition: none !important; } .card:hover { transform: none; } .card:hover .card-media img, .card:hover .card-media video { transform: none; } }
.card-body { padding: 14px; }
.card-title { font-weight: 600; margin: 0 0 6px; font-size: 15px; letter-spacing: -.005em; }
.card-meta { display:flex; justify-content: space-between; align-items:center; color: var(--muted); font-size: 13px; gap: 8px; }
.price { color: var(--accent-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.pill { display:inline-block; padding: 4px 10px; background: var(--elev); border:1px solid var(--border); border-radius: 999px; color: var(--muted); font-size:12px; font-weight: 500; }

/* Text-only card (used when no image is available) */
.text-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: block; color: var(--text); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; box-shadow: var(--shadow-sm); }
.text-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.text-card .card-title { font-weight: 700; margin: 0 0 6px; }
.text-card .card-desc { color: var(--muted); font-size: .95rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Stat cards (dashboard KPIs) */
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px){ .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 480px){ .stat-grid { grid-template-columns: 1fr; } }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
/* Dashboard variant — small diamond corner mark, same shape language as
   the hero stats/mobile menu, so the dashboard reads as the same
   gallery rather than a separate admin-style panel. */
.dash-stat-grid .stat-card { position: relative; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.dash-stat-grid .stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md), 0 0 0 1px rgba(38,47,248,.16); }
.dash-stat-grid .stat-card::before {
  content: ''; position: absolute; top: -9px; right: 10px; width: 14px; height: 14px;
  border: 1.5px solid var(--accent-text); transform: rotate(45deg); opacity: .6;
}
.stat-card .stat-label { color: var(--muted); font-size: 13px; margin: 0 0 8px; font-weight: 500; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; margin: 0; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* Marketplace stats strip — top-level KPIs, OpenSea/Blur-style */
.stats-bar { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card-bg); box-shadow: var(--shadow-sm); }
.stats-bar .stat { padding: 20px 24px; border-right: 1px solid var(--border); }
.stats-bar .stat:last-child { border-right: 0; }
.stats-bar .stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.stats-bar .stat-value { font-size: 24px; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stats-bar .stat-value .stat-change { font-size: 13px; font-weight: 600; margin-left: 6px; }
@media (max-width: 900px){ .stats-bar { grid-template-columns: repeat(2, minmax(0,1fr)); } .stats-bar .stat:nth-child(2n) { border-right: 0; } }
@media (max-width: 480px){ .stats-bar { grid-template-columns: 1fr; } .stats-bar .stat { border-right: 0; border-bottom: 1px solid var(--border); } .stats-bar .stat:last-child { border-bottom: 0; } }

/* Wrapper for the embedded TradingView ticker-tape iframe */
.ticker-tape-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card-bg); box-shadow: var(--shadow-sm); }

/* Avatars, verified badge, inline creator attribution */
.avatar { border-radius: 50%; object-fit: cover; display: inline-block; flex-shrink: 0; background: var(--elev); }
.verified-badge { display: inline-block; vertical-align: middle; width: 16px; height: 16px; flex-shrink: 0; overflow: hidden; white-space: nowrap; text-indent: 9999px; background-image: url("/assets/img/verified-badge.png?v=20260726"); background-repeat: no-repeat; background-position: center; background-size: contain; }
.creator-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.creator-chip .avatar { width: 20px; height: 20px; }
.creator-chip strong { color: var(--ink); font-weight: 600; }

/* Leaderboard / ranked collections table (top-collections pattern) */
.rank-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.rank-table th { text-align: left; padding: 10px 14px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
.rank-table td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; font-variant-numeric: tabular-nums; }
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table tbody tr:hover td { background: var(--elev); }
.rank-table .rank-num { color: var(--muted); font-weight: 600; width: 28px; }
.rank-table .rank-entity { display: flex; align-items: center; gap: 12px; }
.rank-table .rank-entity .avatar { width: 36px; height: 36px; border: 1px solid var(--border); }
.rank-table .rank-name { font-weight: 600; display: flex; align-items: center; gap: 5px; }
.rank-table .rank-sub { color: var(--muted); font-size: 12px; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--ink); }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text); font: inherit;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-card { max-width: 480px; margin: 0 auto; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-sm); }
.form-error { background: var(--danger-bg); color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 16px; }
.form-success { background: var(--success-bg); color: var(--success); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 16px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-bg); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
.table th, .table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.table td { font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }

/* Badges / status pills */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--elev); color: var(--muted); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 12px 18px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; white-space: nowrap; }
.tabs a.active, .tabs a:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* Auth pages (login/register) */
.auth-layout { display: grid; grid-template-columns: 440px 1fr; gap: 40px; align-items: center; padding: 56px 0; }
@media (max-width: 980px) { .auth-layout { grid-template-columns: 1fr; padding: 32px 0; } }
.auth-slider { position: relative; width: 100%; aspect-ratio: 1/1; border-radius: var(--radius-lg); overflow: hidden; background: var(--elev); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.auth-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .5s ease; }
.auth-slide.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .auth-slide { transition: none; } }
.auth-slide-meta { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 0; }
.auth-slide-meta .auth-slide-title { font-weight: 600; }
.auth-slide-meta .auth-slide-sub { font-size: 13px; color: var(--muted); }
.auth-caption { margin-top: 14px; font-size: 13px; color: var(--muted); }
.auth-caption strong { color: var(--ink); }
.form-card h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.01em; }
.form-card .form-lede { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.form-row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; font-size: 14px; flex-wrap: wrap; gap: 8px; }
.form-foot { margin-top: 16px; font-size: 13px; color: var(--muted); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .form-row-2 { grid-template-columns: 1fr; } }
.form-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); }

.auth-layout--balanced { grid-template-columns: 1fr 460px; }
@media (max-width: 980px) { .auth-layout--balanced { grid-template-columns: 1fr; } }
.auth-copy h1 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 900; line-height: 1.08; letter-spacing: -.015em; margin: 0 0 14px; }
.auth-copy p { color: var(--muted); font-size: 16px; max-width: 42ch; }
.auth-copy .checklist { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 11px; }
.auth-copy .checklist li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 14.5px; }
.auth-copy .checklist li::before { content: "✓"; color: var(--success); font-weight: 700; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--muted); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.footer-inner p { margin: 0; font-size: 13.5px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 13.5px; }
.footer-links a:hover { color: var(--accent-text); }

/* Progressive rendering hints */
.card, .hero-card { content-visibility: auto; contain-intrinsic-size: 300px 300px; }

/* ===================== Responsive hardening ===================== */
@media (max-width: 768px){
  .hero { padding: 40px 0 8px; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .nav-search { display:none; }
  .nav-toggle { display:block; }
  .nav-inner { grid-template-columns: auto 1fr auto; height: 60px; }
  /* backdrop-filter establishes a containing block for any
     position:fixed descendant (the drawer + its backdrop below),
     which would anchor them to this ~60px bar instead of the
     viewport. Neutralized here on mobile only — purely cosmetic on
     desktop, load-bearing for the drawer's positioning on mobile. */
  .navbar { backdrop-filter: none; }
  /* Left-side drawer: fixed to the viewport (not the navbar), slides in
     from the left edge via transform rather than a top dropdown. */
  .nav-links {
    display:flex; position:fixed; top:0; left:0; bottom:0; right:auto;
    width:min(82vw, 320px); z-index:1001;
    background:var(--bg); border-top:0; border-right:1px solid var(--border);
    padding:16px; flex-direction:column; align-items:stretch; gap:2px;
    max-height:none; height:100vh; overflow-y:auto; box-shadow: var(--shadow-md);
    transform:translateX(-100%); visibility:hidden;
    transition:transform .3s ease, visibility 0s linear .3s;
  }
  .nav-links[data-open="1"] {
    transform:translateX(0); visibility:visible;
    transition:transform .3s ease;
  }
  .nav-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:999; }

  .nav-profile-strip { display:flex; align-items:center; gap:12px; padding:6px 12px 18px; margin-bottom:8px; border-bottom:1px solid var(--border); }
  .nav-profile-info { min-width:0; }
  .nav-profile-name { font-weight:700; font-size:15px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .nav-profile-strip .badge { margin-top:5px; display:inline-block; }
  /* Diamond bullet ahead of each item — a shape-led marker rather than
     leaning on color/weight alone to separate menu rows. */
  .nav-links > a { position: relative; padding: 14px 12px 14px 30px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav-links > a::before {
    content: ''; position: absolute; left: 10px; top: 50%; width: 7px; height: 7px;
    border: 1.5px solid var(--accent-text); transform: translateY(-50%) rotate(45deg);
  }
  .nav-links > a.btn-primary::before { display: none; }
  .nav-links > a.nav-create-btn { justify-content: center; text-align: center; padding-left: 12px; }
  .nav-links > a.nav-logout-link::before { border-color: var(--danger); }
  .nav-links > a.nav-logout-link { margin-top: 6px; border-top: 1px solid var(--border); }
  .mobile-top-search { display:block; }

  .nav-links .has-children { width: 100%; border-bottom: 1px solid var(--border); }
  .nav-links .parent-row { justify-content: space-between; width: 100%; position: relative; }
  .nav-links .parent-row a { flex: 1; border-bottom: 0; padding-left: 30px; position: relative; }
  .nav-links .parent-row a::before {
    content: ''; position: absolute; left: 10px; top: 50%; width: 7px; height: 7px;
    border: 1.5px solid var(--accent-text); transform: translateY(-50%) rotate(45deg);
  }
  /* One flat drawer: no click-to-expand steps. The Account/More
     sections render permanently open — the toggle arrow is hidden
     since there's nothing left for it to do. */
  .nav-links .submenu-toggle { display: none; }
  .nav-links .submenu { position: static; display: block; box-shadow: none; border: 0; padding: 0 0 10px .75rem; }
  .nav-links .submenu a { position: relative; padding-left: 22px; }
  .nav-links .submenu a::before { content: ''; position: absolute; left: 4px; top: 50%; width: 4px; height: 4px; border-radius: 1px; background: var(--accent-text); transform: translateY(-50%) rotate(45deg); }
  .nav-links .btn-primary { margin-top: 10px; }

  .section { padding: 36px 0; }
  .table { min-width: 420px; }
}
@media (max-width: 480px){
  .container { padding: 0 16px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .form-card { padding: 24px; }
}

/* ===================== Gallery-style additions ===================== */

/* Hero stats strip — small marketplace vitals under the CTA row. */
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); }
.hero-stats > div { position: relative; }
.hero-stats > div:not(:first-child)::before {
  content: ''; position: absolute; left: -14px; top: 50%; width: 5px; height: 5px;
  border: 1.5px solid var(--accent-text); transform: translateY(-50%) rotate(45deg);
}
.hero-stat-num { font-family: 'Fraunces', 'CircularXX', serif; font-size: 22px; font-weight: 600; color: var(--text); line-height: 1.1; }
.hero-stat-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
@media (max-width: 480px) { .hero-stats { gap: 20px; } }

/* Hero slider frame — museum-placard corner brackets around the
   featured-artwork slider, purely decorative (own stacking layer,
   pointer-events disabled so the slider's own controls stay clickable). */
.hero-card { position: relative; }
.hero-card::before, .hero-card::after,
.hero-slider-frame::before, .hero-slider-frame::after { content: ''; position: absolute; width: 26px; height: 26px; border: 2px solid var(--accent); z-index: 2; pointer-events: none; }
.hero-card::before { top: -10px; left: -10px; border-right: 0; border-bottom: 0; }
.hero-card::after { bottom: -10px; right: -10px; border-left: 0; border-top: 0; }

/* Category tiles — a slightly organic, collage-like hover distinct from
   the rigid lift used on artwork cards elsewhere. */
.grid-cats .cat-card { transition: transform .25s ease, box-shadow .25s ease; }
.grid-cats .cat-card:hover { transform: translateY(-3px) rotate(-0.4deg) scale(1.015); }
/* Alternating silhouette — every other tile trades its rounded corner
   for a cut corner, so the grid reads as an irregular, hand-set
   collage rather than a uniform rounded-rectangle wall. Safe to clip
   here (color/text tiles, not artwork photos). */
.grid-cats .cat-card:nth-child(3n+2) { clip-path: polygon(0 0, 100% 0, 100% 100%, 20px 100%, 0 calc(100% - 20px)); border-radius: 0; }
.grid-cats .cat-card:nth-child(3n+3) { clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%, 0 20px); border-radius: 0; }
