:root {
  --bg-main: #000000;
  --bg-surface: #0a0a0a;
  --bg-elevated: #141416;
  --border-subtle: #232329;

  --blue: #2563eb;
  --blue-bright: #3b82f6;
  --pink: #ec4899;
  --pink-bright: #f43f8e;
  --pink-deep: #be185d;

  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* No global smooth scroll: programmatic jumps (e.g. lightbox-close restore)
   stay instant, while user-facing scrolls request smooth explicitly. */

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-x: clip;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  direction: ltr;
}

a {
  color: var(--blue-bright);
  text-decoration: none;
}

a:hover {
  color: var(--pink);
}

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #000000;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--blue-bright), var(--pink)) 1;
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  color: #ffffff;
  flex-shrink: 0;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue-bright);
  flex-shrink: 0;
}

.brand-accent {
  color: var(--pink);
}

/* Search Bar */
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 440px;
}

.search-input {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 2.4rem 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: #ffffff;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.18s ease;
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-input:focus {
  outline: none;
  border-color: var(--blue-bright);
}

.search-input:focus-visible {
  outline: none;
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.45);
}

.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration {
  display: none;
}

.search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #232329;
  color: #ffffff;
  font-size: 0.8rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear.visible {
  display: inline-flex;
}

/* 28px look, 44px tap target */
.search-clear::before {
  content: "";
  position: absolute;
  inset: -8px;
}

/* Category Pills */
.category-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.2rem 0 1rem;
  scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.cat-pill:hover {
  color: #ffffff;
  border-color: var(--blue-bright);
}

.cat-pill.active {
  border-color: var(--blue-bright);
  background: var(--blue);
  color: #ffffff;
}

@media (pointer: coarse) {
  .cat-pill {
    min-height: 44px;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-family: inherit;
}

.btn:hover:not(:disabled) {
  border-color: var(--blue-bright);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  border: 1px solid var(--pink-deep);
  background: var(--pink-deep);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--pink-bright);
  border-color: var(--pink-bright);
}

/* Main container */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1rem 6rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

/* Ad Containers — isolated stacking context so ads NEVER cover header or photos */
.ad-slot {
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0.75rem auto 1.15rem;
  text-align: center;
  clear: both;
  overflow: hidden;
}

.ad-slot iframe {
  max-width: 100%;
}

.ad-slot > div {
  width: 100%;
}

.ad-slot:empty {
  display: none;
  margin: 0;
}

/* Gallery Grid - Mobile First */
.category-bar,
.gallery-grid {
  scroll-margin-top: 84px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.95rem;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.05rem;
  }
}

.photo-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.photo-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue-bright);
}

.photo-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #000000;
  overflow: hidden;
  cursor: pointer;
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-meta {
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  border-top: 1px solid #18181c;
}

.photo-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: var(--pink-deep);
  color: #ffffff;
  flex-shrink: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status & Empty states */
.status-box {
  text-align: center;
  padding: 2.5rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.4rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483640;
  background: #000000;
  display: none;
  flex-direction: column;
  padding: 0.85rem;
  padding-top: max(0.85rem, env(safe-area-inset-top));
  padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
  padding-left: max(0.85rem, env(safe-area-inset-left));
  padding-right: max(0.85rem, env(safe-area-inset-right));
  overscroll-behavior: contain;
}

.lightbox.open {
  display: flex;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.lightbox-info {
  min-width: 0;
}

.lightbox-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-sub {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue-bright);
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* On narrow phones the title + Download + Close don't fit one row */
@media (max-width: 480px) {
  .lightbox-bar {
    flex-wrap: wrap;
  }
  .lightbox-info {
    flex: 1 1 100%;
  }
  .lightbox-actions {
    width: 100%;
  }
  .lightbox-actions .btn-primary {
    flex: 1;
  }
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 0.75rem 0;
  position: relative;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  margin: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.hidden {
  display: none !important;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 1.6rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  user-select: none;
}

.lb-nav:hover {
  border-color: var(--blue-bright);
  color: var(--pink);
}

.lb-prev {
  left: 0.5rem;
}

.lb-next {
  right: 0.5rem;
}

/* Desktop-only 160x300 Ad Rail (hidden on mobile) */
.desktop-ad-rail {
  display: none;
}

@media (min-width: 1540px) {
  .desktop-ad-rail {
    display: flex;
    position: fixed;
    top: 86px;
    right: 12px;
    width: 160px;
    min-height: 300px;
    z-index: 20;
    align-items: flex-start;
    justify-content: center;
  }
  .desktop-ad-rail-left {
    left: 12px;
    right: auto;
    overflow: hidden;
  }
  .desktop-ad-rail-left > div,
  .desktop-ad-rail-left iframe {
    max-width: 100%;
  }
}

/* Anti-Adblock Full-Screen Gate */
.adblock-gate {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: #000000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
}

.adblock-gate.active {
  display: flex;
}

.adblock-card {
  width: 100%;
  max-width: 420px;
  background: #0a0a0a;
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--pink);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.4rem;
  text-align: center;
}

.adblock-card h2 {
  margin: 0.75rem 0 0.5rem;
  font-size: 1.25rem;
  color: #ffffff;
}

.adblock-card p {
  margin: 0 0 1.25rem;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.adblock-card .btn-primary {
  width: 100%;
}

body.ab-locked main,
body.ab-locked header,
body.ab-locked aside,
body.ab-locked .lightbox {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Adults-only age gate (18+, once per session) */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: #000000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
}

.age-gate.active {
  display: flex;
}

.age-gate .btn {
  width: 100%;
}

.age-gate .btn + .btn {
  margin-top: 0.6rem;
}

body.age-locked main,
body.age-locked header,
body.age-locked aside,
body.age-locked .lightbox {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Snappy Android/iOS touch responsiveness (zero 300ms delay / accidental zoom) */
.btn,
.cat-pill,
.lb-nav,
.photo-thumb-wrap,
.search-clear {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.exit-toast {
  position: fixed;
  bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 1rem));
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #141416;
  color: #ffffff;
  border: 1px solid var(--blue-bright);
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  z-index: 2147483645;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.exit-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Screen-reader-only H1: crawlable heading without changing the visual design */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Visible SEO footer: gives search engines real descriptive text to snippet */
.seo-footer {
  max-width: 720px;
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.seo-footer h2 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.seo-footer p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Phone ad fit: every ad stays inside the screen and never covers content */
#ad-bottom {
  min-height: 250px;
}

/* 320px creatives bleed edge-to-edge instead of clipping on narrow phones */
@media (max-width: 360px) {
  #ad-mobile-banner {
    max-width: none;
    margin-left: -1rem;
    margin-right: -1rem;
  }
}

/* Provider iframes (banners, interstitials) never exceed the phone viewport.
   Safe: this site embeds no iframes of its own. */
@media (max-width: 1023px) {
  body iframe {
    max-width: calc(100vw - 2rem);
  }
}
