/* ========================================
   GALLERY — Public-facing styles
   Color palette preserved from original
   ======================================== */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

:root {
  --bg:        #0a0a0a;
  --surface:   rgba(0,0,0,.8);
  --card:      rgba(255,255,255,.04);
  --card-hover:rgba(255,255,255,.08);
  --border:    rgba(255,255,255,.06);
  --text:      #ffffff;
  --text-dim:  #a0a0a0;
  --text-mute: #606060;
  --accent:    #ffffff;
  --success:   #2ed573;
  --danger:    #ff4757;
  --radius:    14px;
  --radius-sm: 8px;
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

/* Scrollbar */
::-webkit-scrollbar { width:6px }
::-webkit-scrollbar-track { background:var(--bg) }
::-webkit-scrollbar-thumb { background:#3a3a3a; border-radius:10px }
::-webkit-scrollbar-thumb:hover { background:#555 }
* { scrollbar-width:thin; scrollbar-color:#3a3a3a var(--bg) }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container { max-width:1360px; margin:0 auto; padding:0 24px }

/* ── Hero ─────────────────────────────── */
.hero {
  position: relative;
  height: 380px;
  overflow: hidden;
}
.hero-banner {
  position: absolute; inset:0;
  background: linear-gradient(135deg, #1a1a2e, #0a0a0a);
  background-size: cover;
  background-position: center;
  will-change: transform;
}
.hero-overlay {
  position: absolute; inset:0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 60%);
}
.hero-content {
  position: absolute; bottom:0; left:0; right:0;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px 32px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
}
.hero-avatar {
  width: 110px; height: 110px;
  border-radius: var(--radius);
  border: 3px solid var(--bg);
  object-fit: cover;
  flex-shrink: 0;
  background: #1a1a1a;
}
.hero-text { flex:1; min-width:0 }
.hero-name { font-size:2rem; font-weight:800; line-height:1.2; letter-spacing:-.02em }
.hero-bio  { font-size:.95rem; color:var(--text-dim); margin-top:6px; line-height:1.5; white-space:pre-line }
.hero-socials {
  display:flex; gap:10px; flex-shrink:0;
}
.hero-socials a {
  width:42px; height:42px;
  display:flex; align-items:center; justify-content:center;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size:24px;
  text-decoration:none;
  transition: background var(--transition), transform var(--transition);
}
.hero-socials a:hover { background:rgba(255,255,255,.1); transform:translateY(-2px) }
.hero-socials a img { width:28px; height:28px; object-fit:contain }

/* ── Toolbar ──────────────────────────── */
.toolbar {
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; flex-wrap:wrap;
  padding: 20px 0 28px;
}
.toolbar-left { display:flex; align-items:center; gap:8px; flex-wrap:wrap; flex:1 }
.toolbar-right { display:flex; align-items:center; gap:10px; flex-shrink:0 }

.chip-group { display:none; gap:6px; flex-wrap:wrap }
.chip {
  padding:7px 16px;
  border:1px solid var(--border);
  border-radius:100px;
  background:transparent;
  color:var(--text-dim);
  font-size:.82rem; font-weight:600;
  cursor:pointer;
  transition: all var(--transition);
  white-space:nowrap;
}
.chip:hover { border-color:rgba(255,255,255,.15); color:var(--text) }
.chip.active { background:var(--text); color:var(--bg); border-color:var(--text) }

/* Tag toggle button */
.chip-toggle {
  display:flex; align-items:center; gap:4px;
  padding:7px 12px;
  border:1px solid var(--border);
  border-radius:100px;
  background:transparent;
  color:var(--text-dim);
  font-size:.82rem; font-weight:600;
  cursor:pointer;
  transition:all var(--transition);
}
.chip-toggle:hover { border-color:rgba(255,255,255,.15); color:var(--text) }
.chip-toggle.open { background:rgba(255,255,255,.08) }

/* Toggle wrapper for dropdown positioning */
.chip-toggle-wrap {
  display:flex;
  position:relative;
  align-items:center;
  gap:6px;
}
.chip-mobile-selected { display:inline-flex }
.chip-dropdown {
  display:none;
  position:absolute;
  top:calc(100% + 6px); left:0;
  min-width:180px;
  background:rgba(20,20,20,.95);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:6px;
  z-index:100;
  backdrop-filter:blur(12px);
  box-shadow:0 8px 24px rgba(0,0,0,.6);
  flex-direction:column; gap:2px;
}
.chip-dropdown.open { display:flex }
.chip-dd-item {
  display:flex; align-items:center; gap:8px;
  padding:10px 14px;
  border:none;
  border-radius:6px;
  background:transparent;
  color:var(--text-dim);
  font-size:.85rem; font-weight:500;
  cursor:pointer;
  transition:all var(--transition);
  text-align:left; white-space:nowrap;
}
.chip-dd-item:hover { background:rgba(255,255,255,.08); color:var(--text) }
.chip-dd-item img { flex-shrink:0 }

.sort-btn {
  display:flex; align-items:center; gap:6px;
  padding:7px 14px;
  border:1px solid var(--border);
  border-radius:100px;
  background:transparent;
  color:var(--text-dim);
  font-size:.82rem; font-weight:600;
  cursor:pointer;
  transition:all var(--transition);
}
.sort-btn:hover { border-color:rgba(255,255,255,.15); color:var(--text) }

/* ── Gallery Grid ─────────────────────── */
.gallery {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap:16px;
}
.gallery[data-cols="1"] { grid-template-columns: 1fr }
.gallery[data-cols="2"] { grid-template-columns: repeat(2, 1fr) }
.gallery[data-cols="3"] { grid-template-columns: repeat(3, 1fr) }
.gallery[data-cols="4"] { grid-template-columns: repeat(4, 1fr) }
.gallery[data-cols="5"] { grid-template-columns: repeat(5, 1fr) }
.gallery[data-cols="6"] { grid-template-columns: repeat(6, 1fr) }
.gallery[data-cols="7"] { grid-template-columns: repeat(7, 1fr) }
.gallery[data-cols="8"] { grid-template-columns: repeat(8, 1fr) }

/* ── Grouped Gallery (All view) ──────── */
.gallery-grouped {
  display:block;
}
.gallery-section {
  margin-bottom:48px;
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}
.section-title {
  font-size:1.4rem;
  font-weight:700;
  margin-bottom:16px;
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--text);
}
.section-title img {
  width:24px; height:24px; object-fit:contain;
}
.section-grid {
  display:grid;
  gap:16px;
  grid-template-columns: repeat(4, 1fr);
}
/* Column config from data-cols attribute */
.section-grid[data-cols="1"] { grid-template-columns: 1fr }
.section-grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr) }
.section-grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr) }
.section-grid[data-cols="4"] { grid-template-columns: repeat(4, 1fr) }
.section-grid[data-cols="5"] { grid-template-columns: repeat(5, 1fr) }
.section-grid[data-cols="6"] { grid-template-columns: repeat(6, 1fr) }
.section-grid[data-cols="7"] { grid-template-columns: repeat(7, 1fr) }
.section-grid[data-cols="8"] { grid-template-columns: repeat(8, 1fr) }
.gallery-loading {
  grid-column:1/-1; display:flex; justify-content:center; padding:80px 0;
}
.spinner {
  width:32px; height:32px;
  border:3px solid var(--border);
  border-top-color:var(--text);
  border-radius:50%;
  animation:spin .7s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

.gallery-empty {
  grid-column:1/-1; text-align:center; padding:80px 20px;
  color:var(--text-dim);
}
.gallery-empty i { font-size:3rem; opacity:.3; margin-bottom:16px; display:block }
.gallery-empty h3 { font-size:1.25rem; font-weight:700; color:var(--text); margin-bottom:6px }

/* Card */
.card {
  position:relative;
  border-radius:var(--radius);
  overflow:hidden;
  background:var(--card);
  aspect-ratio:1;
  cursor:pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  will-change: transform;
  container-type: inline-size;
}
.card:hover { transform:translateY(-4px); box-shadow:0 12px 32px rgba(0,0,0,.5) }

.card img, .card video {
  width:100%; height:100%; object-fit:cover; display:block;
}
.card-video { aspect-ratio:16/9 }
.card-youtube { aspect-ratio:16/9 }

.card-youtube img {
  width:100%; height:100%; object-fit:cover;
}
.card-yt-play {
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  pointer-events:none;
}
.card-yt-play i {
  font-size:48px; color:rgba(255,255,255,.85);
  filter:drop-shadow(0 2px 8px rgba(0,0,0,.5));
}

/* Product links overlay on card hover — sizes scale with card via cqi */
.card-links {
  position:absolute; inset:0;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:clamp(3px, 3cqi, 10px); padding:clamp(6px, 5cqi, 16px);
  background:rgba(0,0,0,.72);
  opacity:0;
  transition:opacity var(--transition);
  pointer-events:none;
}
.card:hover .card-links { opacity:1; pointer-events:all }
.card-link-btn {
  display:flex; align-items:center; justify-content:center;
  gap:clamp(2px, 2cqi, 8px);
  padding:clamp(3px, 3cqi, 10px) clamp(6px, 5cqi, 20px);
  border-radius:clamp(4px, 3cqi, 8px);
  font-size:clamp(.6rem, 6cqi, .85rem); font-weight:600;
  text-decoration:none;
  transition:transform var(--transition);
  min-width:0; width:75cqi;
  box-shadow:0 2px 10px rgba(0,0,0,.3);
}
.card-link-btn:hover { transform:translateY(-2px) }
.card-link-btn img { width:clamp(10px, 8cqi, 16px); height:clamp(10px, 8cqi, 16px); object-fit:contain }

/* ── Pagination ───────────────────────── */
.pagination {
  display:flex; align-items:center; justify-content:center;
  gap:8px; padding:32px 0 24px;
}
.page-arrow {
  width:38px; height:38px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border);
  border-radius:50%;
  background:transparent;
  color:var(--text);
  font-size:.8rem;
  cursor:pointer;
  transition:all var(--transition);
}
.page-arrow:hover:not(:disabled) { background:rgba(255,255,255,.08) }
.page-arrow:disabled { opacity:.25; cursor:default }
.page-num {
  width:38px; height:38px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border);
  border-radius:50%;
  background:transparent;
  color:var(--text-dim);
  font-size:.82rem; font-weight:600;
  cursor:pointer;
  transition:all var(--transition);
}
.page-num:hover { border-color:rgba(255,255,255,.2); color:var(--text) }
.page-num.active { background:var(--text); color:var(--bg); border-color:var(--text) }
.page-ellipsis { font-size:.85rem; color:var(--text-mute); padding:0 2px; user-select:none }
.section-pagination { padding:20px 0 8px; gap:6px }
.section-pagination .page-arrow { width:32px; height:32px; font-size:.72rem }
.section-pagination .page-num { width:32px; height:32px; font-size:.75rem }

/* ── Media Modal ──────────────────────── */
.modal {
  display:none; position:fixed; z-index:2000;
  inset:0;
  background:rgba(0,0,0,.95);
  align-items:center; justify-content:center;
}
.modal.open { display:flex }
.modal-x {
  position:absolute; top:20px; right:24px;
  width:40px; height:40px;
  display:flex; align-items:center; justify-content:center;
  border:none; border-radius:50%;
  background:rgba(255,255,255,.08);
  color:var(--text); font-size:18px;
  cursor:pointer; z-index:10;
  transition:background var(--transition);
}
.modal-x:hover { background:rgba(255,255,255,.15) }
.modal-stage { max-width:90vw; max-height:80vh; display:flex; align-items:center; justify-content:center }
.modal-stage img, .modal-stage video { max-width:100%; max-height:80vh; border-radius:var(--radius-sm); object-fit:contain }
.modal-stage iframe { width:80vw; height:45vw; max-height:80vh; border:none; border-radius:var(--radius-sm) }
.modal-caption {
  position:absolute; bottom:24px; left:50%; transform:translateX(-50%);
  font-size:.85rem; color:var(--text-dim); font-weight:500;
  text-shadow:0 2px 6px rgba(0,0,0,.8);
  text-align:center; max-width:80%;
}

/* ── Footer ───────────────────────────── */
.site-footer {
  margin-top:60px;
  padding:40px 0;
  border-top:1px solid var(--border);
  text-align:center;
}
.footer-avatar {
  width:48px; height:48px; border-radius:50%;
  object-fit:cover; margin-bottom:16px;
  background:#1a1a1a;
}
.footer-socials { display:flex; justify-content:center; gap:12px; margin-bottom:12px }
.footer-socials a {
  width:38px; height:38px;
  display:flex; align-items:center; justify-content:center;
  border-radius:var(--radius-sm);
  color:var(--text); font-size:22px;
  text-decoration:none;
  transition:background var(--transition), transform var(--transition);
}
.footer-socials a:hover { background:rgba(255,255,255,.08); transform:translateY(-2px) }
.footer-socials a img { width:24px; height:24px; object-fit:contain }
.footer-copy { font-size:.8rem; color:var(--text-mute) }

/* ── Responsive ───────────────────────── */
/* 3 sizes: Desktop (default) → Tablet (≤768px) → Mobile (≤480px) */

/* ── TABLET ─────────────────────────── */
@media(max-width:768px) {
  /* Hero */
  .hero { height:300px }
  .hero-content { padding:0 16px 24px; gap:16px }
  .hero-avatar { width:80px; height:80px }
  .hero-name { font-size:1.5rem }
  .hero-bio { font-size:.85rem }
  .hero-socials { gap:6px }
  .hero-socials a { width:36px; height:36px; font-size:20px }
  .hero-socials a img { width:24px; height:24px }
  /* Layout */
  .container { padding:0 16px }
  .toolbar { padding:16px 0 20px }
  .links-card { padding:28px 20px; width:95% }
  /* Grid */
  .gallery { gap:10px }
  .gallery:not([data-cols]) { grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)) }
  .section-grid { gap:10px }
  .section-grid:not([data-cols]) { grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)) }
  .gallery-section { margin-bottom:36px }
  /* Column reduction: ~60% of original */
  .section-grid[data-cols="8"], .gallery[data-cols="8"] { grid-template-columns: repeat(5, 1fr) }
  .section-grid[data-cols="7"], .gallery[data-cols="7"] { grid-template-columns: repeat(4, 1fr) }
  .section-grid[data-cols="6"], .gallery[data-cols="6"] { grid-template-columns: repeat(4, 1fr) }
  .section-grid[data-cols="5"], .gallery[data-cols="5"] { grid-template-columns: repeat(3, 1fr) }
  .section-grid[data-cols="4"], .gallery[data-cols="4"] { grid-template-columns: repeat(3, 1fr) }
  .section-grid[data-cols="3"], .gallery[data-cols="3"] { grid-template-columns: repeat(2, 1fr) }
}

/* ── MOBILE ─────────────────────────── */
@media(max-width:480px) {
  /* Hero */
  .hero { height:auto; padding-top:200px }
  .hero-banner { background-position:center center }
  .hero-overlay { background: linear-gradient(to top, var(--bg) 20%, transparent 80%) }
  .hero-content { position:relative; padding:0 16px 16px; gap:10px }
  .hero-avatar { width:56px; height:56px; border-width:2px }
  .hero-text { overflow:hidden }
  .hero-name { font-size:1.15rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
  .hero-bio { font-size:.8rem }
  .hero-socials { display:none }
  /* Grid */
  .gallery { gap:6px }
  .gallery:not([data-cols]) { grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)) }
  .section-grid { gap:6px }
  .section-grid:not([data-cols]) { grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)) }
  .gallery-section { margin-bottom:28px }
  .section-title { font-size:1.2rem; margin-bottom:12px }
  /* Column reduction: ~50% of original */
  .section-grid[data-cols="8"], .gallery[data-cols="8"] { grid-template-columns: repeat(3, 1fr) }
  .section-grid[data-cols="7"], .gallery[data-cols="7"] { grid-template-columns: repeat(3, 1fr) }
  .section-grid[data-cols="6"], .gallery[data-cols="6"] { grid-template-columns: repeat(3, 1fr) }
  .section-grid[data-cols="5"], .gallery[data-cols="5"] { grid-template-columns: repeat(2, 1fr) }
  .section-grid[data-cols="4"], .gallery[data-cols="4"] { grid-template-columns: repeat(2, 1fr) }
  .section-grid[data-cols="3"], .gallery[data-cols="3"] { grid-template-columns: repeat(2, 1fr) }
  .section-grid[data-cols="2"], .gallery[data-cols="2"] { grid-template-columns: 1fr }
  .section-grid[data-cols="1"], .gallery[data-cols="1"] { grid-template-columns: 1fr }
}
