/* ============================================
   LEAKS GALLERY — Design System & Styles
   Dark Minimalist / TikTok-Style / Mobile-First
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  /* Backgrounds */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-elevated: #1a1a1a;
  --bg-hover: #262626;
  --bg-overlay: rgba(0, 0, 0, 0.75);

  /* Text */
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;

  /* Accent */
  --accent: #e04060;
  --accent-hover: #ff4d73;
  --accent-glow: rgba(224, 64, 96, 0.25);

  /* Borders */
  --border: #262626;
  --border-light: #333333;

  /* Ad */
  --ad-bg: #0d0d0d;
  --ad-border: #1f1f1f;

  /* Typography */
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Sizes */
  --header-height: 56px;
  --bottombar-height: 56px;
  --sidebar-width: 280px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-Index */
  --z-content: 1;
  --z-sticky: 10;
  --z-header: 100;
  --z-sidebar: 200;
  --z-overlay: 150;
  --z-modal: 300;
  --z-toast: 400;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100dvh;
}

body.sidebar-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
}

input, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* ---------- Typography ---------- */
.font-display {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  line-height: 1.1;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-narrow {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ---------- HEADER (Top Navigation) ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-header);
  transition: transform var(--transition-base);
}

.header.hidden {
  transform: translateY(-100%);
}

.header__logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.header__logo span {
  color: var(--accent);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header__btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

.header__btn:hover {
  background: var(--bg-hover);
}

.header__btn svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-primary);
  stroke-width: 2;
  fill: none;
}

/* ---------- SIDEBAR ---------- */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-elevated);
  z-index: var(--z-sidebar);
  transform: translateX(-100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  min-height: var(--header-height);
}

.sidebar__logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar__logo span {
  color: var(--accent);
}

.sidebar__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

.sidebar__close:hover {
  background: var(--bg-hover);
}

.sidebar__close svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  stroke-width: 2;
  fill: none;
}

.sidebar__nav {
  padding: var(--space-md) 0;
}

.sidebar__section-title {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px var(--space-md);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.sidebar__link:hover,
.sidebar__link.active {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-left-color: var(--accent);
}

.sidebar__link svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.sidebar__divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-sm) 0;
}

/* ---------- BOTTOM BAR ---------- */
.bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottombar-height);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: var(--z-header);
  transition: transform var(--transition-base);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottombar.hidden {
  transform: translateY(100%);
}

.bottombar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs);
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color var(--transition-fast);
  position: relative;
}

.bottombar__item.active {
  color: var(--text-primary);
}

.bottombar__item.active::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.bottombar__item svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ---------- AD SLOTS ---------- */
.ad-slot {
  background: var(--ad-bg);
  border: 1px solid var(--ad-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.ad-slot::before {
  content: 'Ad';
  position: absolute;
  top: var(--space-xs);
  right: var(--space-sm);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: rgba(0,0,0,0.6);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  z-index: 2;
}

.ad-slot--banner {
  width: 100%;
  min-height: 250px;
  margin: var(--space-md) 0;
}

.ad-slot--native {
  border: none;
  background: var(--bg-secondary);
}

.ad-slot--fullscreen {
  border: none;
  border-radius: 0;
}

.ad-slot__placeholder {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- TIKTOK FEED (index.html) ---------- */
.feed {
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

.feed__item {
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.feed__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.feed__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed__gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.3) 40%,
    rgba(0,0,0,0.05) 70%,
    transparent 100%
  );
  z-index: 1;
}

.feed__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: var(--space-lg);
  padding-bottom: calc(var(--bottombar-height) + var(--space-xl));
  display: flex;
  align-items: flex-end;
  gap: var(--space-md);
  pointer-events: none;
}

.feed__content a,
.feed__content button,
.feed__content [data-like],
.feed__content [data-share],
.feed__content [data-save] {
  pointer-events: auto;
}

.feed__info {
  flex: 1;
  min-width: 0;
}

.feed__model {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.feed__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  object-fit: cover;
}

.feed__model-name {
  font-size: 0.9375rem;
  font-weight: 600;
}

.feed__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  line-height: 1.15;
  margin-bottom: var(--space-xs);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.feed__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.feed__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.feed__meta-item svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.feed__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.feed__tag {
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 0.85;
}

/* Feed side actions */
.feed__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding-bottom: var(--space-md);
}

.feed__action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.feed__action-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
}

.feed__action-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

.feed__action-btn.liked {
  background: var(--accent-glow);
}

.feed__action-btn.liked svg {
  stroke: var(--accent);
  fill: var(--accent);
}

.feed__action-btn svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
}

.feed__action-count {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

/* Feed Ad Slide */
.feed__item--ad {
  background: var(--bg-secondary);
}

.feed__item--ad .feed__gradient {
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.7) 0%,
    rgba(0,0,0,0.1) 50%,
    transparent 100%
  );
}

.feed__ad-badge {
  position: absolute;
  top: calc(var(--header-height) + var(--space-md));
  left: var(--space-md);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: rgba(0,0,0,0.7);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  z-index: 3;
  backdrop-filter: blur(8px);
}

/* ---------- PAGE (page.html) — Photoset ---------- */
.page-content {
  padding-top: 0;
  padding-bottom: 0;
  min-height: 100dvh;
}

/* Vertical TikTok-style gallery for page.html */
.page-gallery {
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.page-gallery::-webkit-scrollbar {
  display: none;
}

.page-gallery__slide {
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}

.page-gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Counter overlay on vertical gallery */
.page-gallery__counter {
  position: fixed;
  top: calc(var(--header-height) + var(--space-md));
  right: var(--space-md);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  z-index: var(--z-sticky);
  pointer-events: none;
}

/* Info overlay on the first slide */
.page-gallery__info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-lg);
  padding-bottom: calc(var(--bottombar-height) + var(--space-xl));
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.4) 50%,
    transparent 100%
  );
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: var(--space-md);
}

.page-gallery__details {
  flex: 1;
  min-width: 0;
}

.page-gallery__model {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.page-gallery__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  object-fit: cover;
}

.page-gallery__model-name {
  font-size: 0.9375rem;
  font-weight: 600;
}

.page-gallery__model-name:hover {
  color: var(--accent);
}

.page-gallery__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  line-height: 1.15;
  margin-bottom: var(--space-xs);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.page-gallery__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.page-gallery__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-gallery__meta-item svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.page-gallery__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.page-gallery__tag {
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 0.85;
}

/* Side actions for page gallery (reuse feed__actions style) */
.page-gallery__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding-bottom: var(--space-md);
}

/* "more below" section after gallery */
.page-gallery__after {
  padding-top: var(--header-height);
  padding-bottom: calc(var(--bottombar-height) + var(--space-lg));
}

.photoset-header {
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border);
}

.photoset-header__model {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.photoset-header__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  object-fit: cover;
}

.photoset-header__model-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.photoset-header__model-name:hover {
  color: var(--accent);
}

.photoset-header__date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.photoset-header__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-sm);
}

.photoset-header__stats {
  display: flex;
  gap: var(--space-lg);
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.photoset-header__stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.photoset-header__stat svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Gallery Slider */
.gallery-slider {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
}

.gallery-slider__track {
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.gallery-slider__track::-webkit-scrollbar {
  display: none;
}

.gallery-slider__slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  max-height: 75vh;
}

.gallery-slider__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-slider__counter {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 2;
}

.gallery-slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all var(--transition-fast);
  display: none; /* show on desktop */
}

.gallery-slider__nav:hover {
  background: rgba(0,0,0,0.8);
}

.gallery-slider__nav--prev { left: var(--space-sm); }
.gallery-slider__nav--next { right: var(--space-sm); }

.gallery-slider__nav svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
}

/* Progress dots */
.gallery-slider__dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: var(--space-md);
}

.gallery-slider__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  transition: all var(--transition-fast);
}

.gallery-slider__dot.active {
  background: var(--accent);
  width: 18px;
}

/* Photoset actions bar */
.photoset-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.photoset-actions__left {
  display: flex;
  gap: var(--space-md);
}

.photoset-actions__btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.photoset-actions__btn:hover {
  color: var(--text-primary);
}

.photoset-actions__btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.photoset-actions__btn.liked svg {
  fill: var(--accent);
  stroke: var(--accent);
}

/* Tags */
.photoset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-md);
}

.tag {
  padding: 4px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border: 1px solid var(--border);
}

.tag:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

/* ---------- Related Grid ---------- */
.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  padding: var(--space-lg) var(--space-md) var(--space-md);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding: 0 2px;
}

.card {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--bg-secondary);
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card__img {
  transform: scale(1.05);
}

.card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.8) 0%,
    transparent 60%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-md);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover .card__overlay {
  opacity: 1;
}

/* Always show on mobile */
@media (hover: none) {
  .card__overlay {
    opacity: 1;
  }
}

.card__title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  letter-spacing: 0.03em;
  line-height: 1.2;
  margin-bottom: 2px;
}

.card__model {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.card__photo-count {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 3px;
}

.card__photo-count svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ---------- MODEL PAGE ---------- */
.model-hero {
  padding: var(--space-2xl) var(--space-md) var(--space-lg);
  padding-top: calc(var(--header-height) + var(--space-2xl));
  text-align: center;
  position: relative;
}

.model-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.model-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(30px) brightness(0.3);
  transform: scale(1.2);
}

.model-hero__content {
  position: relative;
  z-index: 1;
}

.model-hero__avatar {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  border: 3px solid var(--accent);
  margin: 0 auto var(--space-md);
  object-fit: cover;
}

.model-hero__name {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.model-hero__bio {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto var(--space-lg);
}

.model-hero__stats {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
}

.model-hero__stat {
  text-align: center;
}

.model-hero__stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.03em;
}

.model-hero__stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-height);
  background: var(--bg-primary);
  z-index: var(--z-sticky);
}

.tabs__tab {
  flex: 1;
  padding: var(--space-md);
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: relative;
  transition: color var(--transition-fast);
}

.tabs__tab.active {
  color: var(--text-primary);
}

.tabs__tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.tabs__tab:hover {
  color: var(--text-secondary);
}

/* ---------- CATEGORY PAGE ---------- */
.category-header {
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  padding-top: calc(var(--header-height) + var(--space-xl));
  border-bottom: 1px solid var(--border);
}

.category-header__title {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.category-header__desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.category-header__count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Filters */
.filters {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: var(--header-height);
  background: var(--bg-primary);
  z-index: var(--z-sticky);
  border-bottom: 1px solid var(--border);
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-btn.active,
.filter-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--accent);
}

/* Load More */
.load-more {
  display: flex;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  padding-bottom: calc(var(--bottombar-height) + var(--space-xl));
}

.load-more__btn {
  padding: 12px 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.load-more__btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-glow);
}

/* ---------- SEARCH PAGE ---------- */
.search-page {
  padding-top: var(--header-height);
  padding-bottom: calc(var(--bottombar-height) + var(--space-lg));
  min-height: 100dvh;
}

.search-bar {
  position: sticky;
  top: var(--header-height);
  background: var(--bg-primary);
  padding: var(--space-md);
  z-index: var(--z-sticky);
  border-bottom: 1px solid var(--border);
}

.search-bar__input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px var(--space-md);
  transition: border-color var(--transition-fast);
}

.search-bar__input-wrapper:focus-within {
  border-color: var(--accent);
}

.search-bar__input-wrapper svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.search-bar__input {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.search-bar__input::placeholder {
  color: var(--text-muted);
}

/* Trending Tags */
.trending {
  padding: var(--space-lg) var(--space-md);
}

.trending__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.trending__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.chip:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
  min-height: 40vh;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  fill: none;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-state__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.empty-state__desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ---------- LEGAL PAGES ---------- */
.legal-page {
  padding-top: calc(var(--header-height) + var(--space-xl));
  padding-bottom: calc(var(--bottombar-height) + var(--space-xl));
  min-height: 100dvh;
}

.legal-page .container-narrow {
  max-width: 680px;
}

.legal-page h1 {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.legal-page__date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.legal-page h2 {
  font-size: 1.25rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.legal-page p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.legal-page ul {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.legal-page li {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  list-style: disc;
  margin-bottom: var(--space-xs);
}

.legal-page a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-page a:hover {
  color: var(--accent-hover);
}

/* Legal sidebar TOC */
.legal-toc {
  display: none;
}

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl) var(--space-md);
  padding-bottom: calc(var(--bottombar-height) + var(--space-xl));
  text-align: center;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.footer__link {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--text-secondary);
}

.footer__copy {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.animate-fade-in {
  animation: fadeIn var(--transition-base) both;
}

.animate-slide-up {
  animation: slideUp var(--transition-slow) both;
}

/* ---------- DESKTOP BREAKPOINTS ---------- */
@media (min-width: 768px) {
  .bottombar {
    display: none;
  }

  .page-content,
  .search-page,
  .legal-page {
    padding-bottom: var(--space-xl);
  }

  .feed__content {
    padding-bottom: var(--space-xl);
    max-width: 600px;
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-slider__nav {
    display: flex;
  }

  .footer {
    padding-bottom: var(--space-xl);
  }

  .load-more {
    padding-bottom: var(--space-xl);
  }

  /* Legal TOC on desktop */
  .legal-layout {
    display: flex;
    gap: var(--space-xl);
    max-width: 960px;
    margin: 0 auto;
    padding: 0 var(--space-md);
  }

  .legal-toc {
    display: block;
    position: sticky;
    top: calc(var(--header-height) + var(--space-lg));
    width: 200px;
    flex-shrink: 0;
    align-self: flex-start;
  }

  .legal-toc__title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
  }

  .legal-toc__link {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: var(--space-xs) 0;
    border-left: 2px solid var(--border);
    padding-left: var(--space-md);
    transition: all var(--transition-fast);
  }

  .legal-toc__link:hover,
  .legal-toc__link.active {
    color: var(--text-primary);
    border-left-color: var(--accent);
  }

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

@media (min-width: 768px) {
  /* Desktop page gallery — contain images, don't stretch */
  .page-gallery__slide {
    background: #000;
  }

  .page-gallery__slide img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
  }

  .page-gallery__info {
    max-width: 50%;
    padding-bottom: var(--space-2xl);
  }

  .page-gallery__actions {
    position: absolute;
    right: var(--space-xl);
    bottom: var(--space-2xl);
  }

  .page-gallery__counter {
    right: var(--space-lg);
  }

  .page-gallery__title {
    font-size: 2rem;
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .feed__content {
    max-width: 700px;
  }

  .feed__title {
    font-size: 2rem;
  }

  /* Desktop page gallery — even more constrained */
  .page-gallery__slide img {
    max-height: 100dvh;
    max-width: 100%;
    width: auto;
    height: auto;
    min-height: 70dvh;
  }
}

/* ---------- Lazy Load ---------- */
img[data-src] {
  opacity: 0;
  transition: opacity var(--transition-base);
}

img[data-src].loaded {
  opacity: 1;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Feed scrollbar invisible */
.feed::-webkit-scrollbar {
  display: none;
}

.feed {
  scrollbar-width: none;
}


/* ─── AG3 EXTRAS ─── */
.feed__avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Post Page */
.post-page {
  padding-bottom: calc(var(--bottombar-height) + var(--space-xl));
}

.post-hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100dvh - var(--header-height));
}

.post-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.post-hero__gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.post-hero__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-lg);
  z-index: 2;
}

.post-hero__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  margin-bottom: var(--space-xs);
}

.post-body {
  padding: var(--space-lg) var(--space-md);
}

.post-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.post-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-bottom: var(--space-lg);
}

.post-gallery__item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  display: block;
}

.post-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.post-gallery__item:hover img {
  transform: scale(1.08);
}

/* Error Page */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
}

.error-page__code {
  font-family: var(--font-display);
  font-size: 8rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), #ff8a65);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.error-page__text {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin: var(--space-md) 0 var(--space-xl);
}

.error-page__btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-full);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.error-page__btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* Legal Pages */
.legal-page {
  padding: calc(var(--header-height) + var(--space-lg)) var(--space-md) calc(var(--bottombar-height) + var(--space-xl));
}

.legal-layout {
  max-width: 720px;
  margin: 0 auto;
}

.legal-content h1 {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.legal-content h2 {
  font-size: 1.25rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.legal-content p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.legal-content ul {
  list-style: disc;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.legal-content li {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: var(--space-xs);
}

.legal-content a {
  color: var(--accent);
  text-decoration: underline;
}

.legal-page__date {
  color: var(--text-muted) !important;
  font-size: 0.8125rem !important;
  margin-bottom: var(--space-lg) !important;
}

/* Feed link fix */
.feed__bg {
  display: block;
}

/* Desktop adaptations */
@media (min-width: 768px) {
  .post-gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .post-gallery {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }
  
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .feed__title {
    font-size: 2rem;
  }
}

/* Share Popup */
.share-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.share-popup.active {
  opacity: 1;
  pointer-events: auto;
}
.share-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
.share-popup__menu {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #1a1a1a;
  border-radius: 16px 16px 0 0;
  padding: 12px 0;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.share-popup.active .share-popup__menu {
  transform: translateY(0);
}
.share-popup__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  padding: 8px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.share-popup__item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 20px;
  color: var(--text-primary);
  font-size: 0.9375rem;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.share-popup__item:hover {
  background: rgba(255,255,255,0.06);
}
.share-popup__item svg {
  fill: currentColor;
  flex-shrink: 0;
}

/* Saved/Bookmark state */
[data-save].saved svg {
  fill: var(--accent);
  stroke: var(--accent);
}

/* Liked state */
[data-like].liked svg {
  fill: var(--accent);
  stroke: var(--accent);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
