:root {
  --ground: #F3F1EC;
  --ink: #1C1B19;
  --muted: #6B675F;
  --rule: #D6D1C7;
  --red: #C8001E;
  --tile: #DDD8CE;
  --serif: 'Newsreader', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --gutter: 64px;
  --gap: 14px;
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --gap: 8px; }
}

* { box-sizing: border-box; }
html { background: var(--ground); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--mono);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
a:hover { color: var(--muted); }
.red { color: var(--red); }

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }

/* Header + red bar */
.top {
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px;
  padding-top: 40px; padding-bottom: 20px;
  position: relative; z-index: 2;
}
.brand { font-family: var(--serif); font-size: 22px; text-decoration: none; color: var(--ink); }
.shot { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }
.bar { height: 8px; background: var(--red); border-radius: 8px; position: relative; z-index: 2; }
@media (max-width: 640px) {
  .top { padding-top: 20px; padding-bottom: 14px; }
  .brand { font-size: 18px; }
  .shot { font-size: 10px; }
}

/* Hero */
.hero { position: relative; }
.daruma {
  position: absolute; top: 20px; right: -4vw;
  height: min(42vw, 620px); width: auto;
  opacity: 0.6; mix-blend-mode: multiply;
  z-index: 0; pointer-events: none; user-select: none;
}
@media (max-width: 640px) {
  .daruma { top: 12px; right: -26vw; height: 58vw; }
}
.title {
  margin: 0; position: relative; z-index: 1;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(64px, 12vw, 180px); line-height: 0.9; letter-spacing: -0.02em;
  padding: 0.88em 0 0.42em;
}
@media (max-width: 640px) {
  .title { padding: 0.875em 0 0.375em; }
}

/* Filters */
.filters {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 40px;
  padding-bottom: 28px; position: relative; z-index: 1;
}
.place { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.label { font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.chip {
  min-height: 44px; padding: 0; background: none; border: 0; border-bottom: 1px solid transparent;
  font: inherit; font-size: 13px; color: var(--muted); cursor: pointer;
}
.chip[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--red); }
.count { font-size: 12px; color: var(--muted); background: var(--ground); padding: 2px 8px; border-radius: 2px; }
@media (max-width: 640px) {
  .filters { padding-bottom: 14px; }
  .label, .count { display: none; }
  .place { gap: 22px; }
}

/* Grid */
.grid { display: flex; flex-direction: column; gap: var(--gap); position: relative; z-index: 1; min-height: 40vh; }
.row { display: flex; gap: var(--gap); align-items: flex-start; }
.tile {
  position: relative; display: block; min-width: 0; padding: 0; border: 0;
  background: var(--tile); cursor: zoom-in; overflow: hidden;
}
.tile img, .tile video { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile .tag {
  position: absolute; left: 10px; bottom: 8px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em;
  color: #F3F1EC; text-shadow: 0 0 6px rgba(0,0,0,0.55);
}
@media (max-width: 640px) { .tile .tag { left: 6px; bottom: 5px; font-size: 7px; } }
.tile:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.empty { font-size: 13px; color: var(--muted); padding: 80px 0; text-align: center; }

/* Footer */
.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-top: 72px; padding: 20px 0 64px; border-top: 1px solid var(--rule);
  font-size: 12px; color: var(--muted); position: relative; z-index: 1;
}
.foot a { color: var(--muted); }

/* Fullscreen viewer */
.viewer {
  position: fixed; inset: 0; z-index: 50; background: #161513; color: #ECE8E0;
  display: none; flex-direction: column;
}
.viewer.open { display: flex; }
.v-top { height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 16px; }
.v-count { font-size: 12px; color: #B5AFA4; }
.v-btn {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: #ECE8E0; cursor: pointer; padding: 0;
}
.v-btn:hover { color: #B5AFA4; }
.v-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; touch-action: pan-y; }
.v-stage img, .v-stage video { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.v-prev, .v-next { position: absolute; top: 50%; transform: translateY(-50%); }
.v-prev { left: 8px; } .v-next { right: 8px; }
@media (max-width: 640px) { .v-prev, .v-next { display: none; } }
.v-bottom { min-height: 88px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 6px 0 16px; }
.v-place { font-family: var(--serif); font-size: 20px; }
.v-caption { font-size: 11px; color: #B5AFA4; margin-top: 4px; }
.v-sound { border: 1px solid rgba(236,232,224,0.3); border-radius: 22px; }
.v-sound[hidden] { display: none; }
