/* Pixelrest — image-forward gallery. Near-black chrome so the artwork carries
   the colour; everything else recedes. */

:root {
  --bg:      #08090c;
  --panel:   #101319;
  --panel-2: #171b23;
  --border:  #212734;
  --text:    #f0f2f6;
  --muted:   #98a1b2;
  --faint:   #656f80;
  --accent:  #f472b6;
  --accent-2:#fb923c;
  --r:       12px;
  --sans:    "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono:    ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.025em; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.3rem; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; background: var(--accent); color: #180810; padding: 10px 16px; border-radius: var(--r); z-index: 99; }

/* Header ---------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(8,9,12,.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 18px; height: 62px; max-width: 1240px; margin: 0 auto; padding: 0 22px; }
.logo { font-size: 1.2rem; font-weight: 700; color: var(--text); letter-spacing: -.03em; }
.logo b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { margin-left: auto; display: flex; gap: 3px; }
.nav a { font-size: .89rem; color: var(--muted); padding: 8px 12px; border-radius: 8px; }
.nav a:hover, .nav a.is-active { color: var(--text); background: var(--panel-2); text-decoration: none; }

/* Hero ------------------------------------------------------------------ */
.hero { padding: 54px 0 26px; }
.hero h1 { font-size: 2.9rem; max-width: 18ch; }
.hero h1 b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); max-width: 56ch; font-size: 1.05rem; margin: 0; }

/* Controls -------------------------------------------------------------- */
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 22px 0 6px; }
.chip {
  padding: 8px 15px; border-radius: 999px; font-size: .87rem; font-weight: 600;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; font-family: inherit;
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.spacer { margin-left: auto; }

select.mini {
  padding: 8px 12px; border-radius: 999px; font-size: .85rem;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  font-family: inherit; cursor: pointer;
}

/* Gallery --------------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; padding: 20px 0 0; }

.tile {
  position: relative; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--border); background: var(--panel);
  aspect-ratio: 16 / 10; cursor: pointer;
}
.tile canvas { display: block; width: 100%; height: 100%; }
.tile figcaption {
  position: absolute; inset: auto 0 0 0; padding: 26px 14px 12px;
  background: linear-gradient(to top, rgba(0,0,0,.8), transparent);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 10px;
  opacity: 0; transition: opacity .18s;
}
.tile:hover figcaption, .tile:focus-within figcaption { opacity: 1; }
.tile .name { font-size: .9rem; font-weight: 600; }
.tile .seed { font-family: var(--mono); font-size: .68rem; color: var(--muted); }

.mini-btn {
  border: 0; border-radius: 8px; padding: 7px 12px; cursor: pointer;
  background: rgba(255,255,255,.92); color: #111; font-family: inherit;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.mini-btn:hover { background: #fff; }

/* Lightbox -------------------------------------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(4,5,8,.93); backdrop-filter: blur(6px);
  padding: 22px; overflow: auto;
}
.lightbox.is-open { display: grid; place-items: center; }
.lb-inner { width: min(1000px, 100%); }
.lb-canvas-wrap { border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); background: var(--panel); }
.lb-canvas-wrap canvas { display: block; width: 100%; height: auto; }
.lb-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.lb-bar h2 { margin: 0; font-size: 1.05rem; }
.lb-meta { font-family: var(--mono); font-size: .74rem; color: var(--faint); }

.btn {
  display: inline-block; padding: 11px 20px; border: 0; border-radius: 9px;
  background: var(--accent); color: #1a0710; font-weight: 700; font-size: .9rem;
  cursor: pointer; font-family: inherit;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--panel-2); }

/* Prose ----------------------------------------------------------------- */
.prose { padding: 30px 0 50px; }
.prose h2 { margin-top: 1.7em; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.prose code { background: var(--panel-2); color: var(--accent); padding: 2px 6px; border-radius: 5px; font-family: var(--mono); font-size: .88em; }
.callout { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent-2); border-radius: var(--r); padding: 16px 18px; margin: 1.5em 0; }
.callout strong { display: block; margin-bottom: 4px; color: var(--text); }
.callout p { margin: 0; font-size: .92rem; }

.section-title { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); font-weight: 700; margin: 40px 0 4px; }

/* Ad slots -------------------------------------------------------------- */
.ad-slot { display: flex; flex-direction: column; align-items: center; margin: 0 auto; overflow: hidden; }
.ad-slot iframe { border: 0; display: block; }
.ad-slot::before {
  content: attr(data-ad-label); display: block; margin-bottom: 6px;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
}
.ad-leaderboard { min-height: 106px; padding: 18px 0; }
.ad-rectangle   { min-height: 266px; }
.ad-native      { min-height: 200px; margin: 30px 0; }

/* An in-grid ad occupies one tile so the masonry rhythm is not broken. */
.ad-tile { grid-column: span 1; min-height: 266px; justify-content: center; }

.ad-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 100%; gap: 3px; padding: 12px; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--r);
  background: repeating-linear-gradient(45deg, var(--panel), var(--panel) 10px, var(--panel-2) 10px, var(--panel-2) 20px);
  color: var(--faint); font-family: var(--mono); font-size: .7rem;
}
.ad-placeholder b { color: var(--muted); font-size: .78rem; }

/* Footer ---------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--panel); padding: 28px 0; margin-top: 50px; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 0 22px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; font-size: .86rem; color: var(--faint); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.ad-disclosure { text-align: center; font-size: .81rem; color: var(--faint); padding: 0 22px 14px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(14px);
  background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 999px;
  font-size: .87rem; font-weight: 700; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 95;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Responsive ------------------------------------------------------------ */
/* Logo + three nav links stop fitting around 560px. */
@media (max-width: 560px) {
  .header-inner { height: auto; flex-wrap: wrap; gap: 8px; padding-top: 14px; padding-bottom: 14px; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; }
}

@media (max-width: 700px) {
  .hero h1 { font-size: 2.1rem; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .tile figcaption { opacity: 1; }
  .ad-leaderboard { min-height: 76px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Sister-site strip ------------------------------------------------------- */
.network { max-width: 1240px; margin: 0 auto; padding: 20px 22px 4px; }
.network-label {
  display: block; margin-bottom: 12px;
  font-family: var(--mono); font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--faint);
}
.network-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.network-links a {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r);
  padding: 13px 15px; font-size: .86rem; font-weight: 600; color: var(--text);
}
.network-links a span { display: block; font-weight: 400; font-size: .74rem; color: var(--muted); margin-top: 2px; }
.network-links a:hover { text-decoration: none; border-color: var(--accent); }
@media (max-width: 700px) { .network-links { grid-template-columns: 1fr 1fr; } }
