:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #5f5f5f;
  --line: #e8e8e8;
  --chip: #efefef;
  --chip-hover: #e2e2e2;
  --red: #e60023;
  --radius: 14px;
  --gap: 16px;
  --col: 138px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.4 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a,
button,
input {
  touch-action: manipulation;
}
:focus-visible {
  outline: 2px solid #0076ff;
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -56px;
  z-index: 60;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip:focus {
  top: 12px;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  padding: 12px 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--red);
  letter-spacing: -0.2px;
  text-decoration: none;
}
.search {
  flex: 1 1 auto;
  max-width: 720px;
  min-width: 120px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  padding: 0 18px;
  font: inherit;
  font-size: 15px;
  outline: none;
}
.search:focus {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 118, 255, 0.25);
}

.size {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}
.size input[type="range"] {
  width: 130px;
  min-height: 44px;
  accent-color: var(--red);
  cursor: pointer;
}
.size output {
  min-width: 52px;
  font-variant-numeric: tabular-nums;
}

.hero {
  width: 100%;
  padding: 20px 16px 4px;
}
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 4vw, 38px);
  letter-spacing: -0.5px;
  text-wrap: balance;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 16px 6px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid #ddd;
  background: #fff;
  color: var(--ink);
  padding: 11px 18px;
  border-radius: 999px;
  font: 600 14px inherit;
  cursor: pointer;
}
.chip:hover {
  background: var(--chip-hover);
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.status {
  padding: 6px 16px 0;
  color: var(--muted);
  font-size: 13px;
}

/* Poster wall: each pin keeps its own aspect ratio and the columns balance
   themselves. Full width, no capped container. `--col` is the narrowest a
   column may get; the browser picks how many fit. */
.grid {
  width: 100%;
  padding: 16px;
  columns: var(--col);
  column-gap: var(--gap);
}

.pin {
  display: block;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 var(--gap);
  text-decoration: none;
  color: inherit;
}
.pin .thumb {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--chip);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.12s ease;
}
.pin:hover .thumb {
  filter: brightness(0.96);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.pin:active .thumb {
  filter: brightness(0.88);
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.pin .body {
  padding: 6px 0 0;
}
.pin .ptitle {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pin .byline {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  padding: 80px 16px;
  text-align: center;
  color: var(--muted);
}
footer {
  width: 100%;
  padding: 28px 16px 44px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  font: 700 14px inherit;
  cursor: pointer;
}

/* Bottom tab bar, phone only. */
.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar .tabs {
  display: flex;
}
.tab {
  flex: 1 1 0;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 600 11px/1.2 inherit;
  text-decoration: none;
  cursor: pointer;
}
.tab svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.tab[aria-current="true"] {
  color: var(--ink);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}
.sheet[hidden] {
  display: none;
}
.sheet-panel {
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom, 0px));
}
.sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #ddd;
  margin: 0 auto 12px;
}
.sheet-panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.sheet-panel p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

@media (min-width: 701px) and (max-width: 1024px) {
  header {
    gap: 10px;
    padding: 10px 14px;
  }
  .size input[type="range"] {
    width: 110px;
  }
  .grid {
    columns: 3;
    column-gap: 12px;
    padding: 14px;
  }
  .pin .ptitle {
    font-size: 12.5px;
  }
  .hero {
    padding: 16px 14px 2px;
  }
}

@media (max-width: 700px) {
  header {
    gap: 8px;
    padding: 8px 12px;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }
  .brand {
    font-size: 17px;
  }
  .size > span {
    display: none;
  }
  .size input[type="range"] {
    width: 90px;
  }
  .search {
    order: 3;
    flex: 1 1 100%;
    min-width: 0;
  }
  .hero {
    padding: 12px 12px 2px;
  }
  .hero h1 {
    font-size: 24px;
  }
  .hero p {
    font-size: 13px;
  }
  .chips {
    padding: 12px 12px 4px;
  }
  .chip {
    min-height: 44px;
  }
  .status {
    padding-left: 12px;
    padding-right: 12px;
  }
  /* Two columns on a phone, never one: the wall stays dense. */
  .grid {
    columns: 2;
    column-gap: 10px;
    padding: 12px;
  }
  .pin {
    margin-bottom: 10px;
  }
  .pin .ptitle {
    font-size: 12px;
  }
  .pin .byline {
    font-size: 11px;
  }
  .tabbar {
    display: block;
  }
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.site-footer .dot { opacity: 0.5; }

.pagination-wrap {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 32px 0 24px;
  flex-wrap: wrap;
}

.pagination-wrap button {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  color: #f5f5f5;
  padding: 10px 18px;
  border-radius: 999px;
  font: 600 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  cursor: pointer;
  box-shadow: 0 10px 30px -20px rgba(255,255,255,0.8);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.pagination-wrap button:hover {
  border-color: rgba(255,255,255,0.28);
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  transform: translateY(-1px);
}

.pagination-wrap button:active {
  transform: translateY(0);
}

.pagination-wrap .view-all {
  border-color: rgba(255,255,255,0.18);
}
