:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  color: #f8f4ef;
  background: #151319;
  --muted: #c0b5c6;
  --line: #423747;
  --accent: #f2b1cc;
  --surface: #211b26;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid #ffdbeb; outline-offset: 3px; }

.shell { width: min(100% - 3rem, 68rem); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar-content, .catalog-heading, .footer, .dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar-content { min-height: 4.5rem; }
.brand { font-size: 2rem; font-weight: 850; letter-spacing: -.085em; text-decoration: none; }
.brand span, .age { color: var(--accent); }
.age { font-size: .875rem; font-weight: 700; }
.age span { color: var(--muted); margin-left: .4rem; font-weight: 500; }

.intro { padding-block: clamp(3rem, 8vw, 6rem) 2.5rem; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(2.9rem, 7.7vw, 6rem); line-height: .98; letter-spacing: -.07em; }
h1 em { color: var(--accent); font-family: "Instrument Serif", Georgia, serif; font-weight: 400; letter-spacing: -.06em; }
.intro > p { color: var(--muted); margin-top: 1.15rem; line-height: 1.55; }
.intro .demo { color: var(--accent); font-size: .85rem; }

.filters { display: grid; grid-template-columns: 1fr minmax(12rem, 25%); gap: 1rem; }
label { display: grid; gap: .45rem; font-size: .875rem; font-weight: 650; min-width: 0; }
input, select, textarea {
  min-height: 3rem;
  width: 100%;
  padding: .7rem .85rem;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .55rem;
  font-size: 1rem;
  font-weight: 400;
}
input::placeholder { color: var(--muted); }
textarea { resize: vertical; }

.catalog-heading { margin-block: 2.15rem 1rem; }
h2 { font-size: 1.3rem; letter-spacing: -.025em; }
#count, .footer, .empty, .hint { color: var(--muted); font-size: .875rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.card { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: .85rem; }
.card-content { padding: 1.25rem; }
.tag { display: inline-block; padding: .25rem .55rem; border-radius: .35rem; background: #3c293d; color: #ffd0e3; font-size: .78rem; font-weight: 650; }
.card h3 { margin-block: .8rem 1.1rem; font-size: 1.5rem; letter-spacing: -.04em; overflow-wrap: anywhere; }
.metadata { display: grid; grid-template-columns: 1fr auto; gap: .7rem; font-size: .875rem; }
.metadata dt { color: var(--muted); margin-bottom: .25rem; }
.metadata dd { overflow-wrap: anywhere; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; padding: .85rem 1.25rem; border-top: 1px solid var(--line); }
.visit, .report, .close { min-height: 2.75rem; border-radius: .45rem; font-size: .875rem; font-weight: 700; }
.visit { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .75rem; color: #241420; background: var(--accent); border: 0; text-decoration: none; }
.visit:hover { background: #ffd1e4; }
.report, .close { background: transparent; border: 0; color: var(--muted); padding: .45rem .15rem; }
.report:hover, .close:hover { color: #fff; text-decoration: underline; }
.footer { border-top: 1px solid var(--line); margin-top: 3rem; padding-block: 1.2rem; flex-wrap: wrap; }

dialog { width: min(30rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: .85rem; color: inherit; }
dialog::backdrop { background: rgb(11 8 13 / 78%); }
.close { width: 2.75rem; font-size: 1.5rem; }
#report-link { color: var(--accent); margin-bottom: .85rem; }
#report-form, #report-preview { display: grid; gap: 1rem; justify-items: start; }
#report-form label { width: 100%; }
.hint { line-height: 1.45; }
pre { width: 100%; margin: 0; padding: .8rem; border: 1px solid var(--line); border-radius: .45rem; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 38rem) {
  .shell { width: calc(100% - 2rem); }
  .filters { grid-template-columns: 1fr; }
  .topbar-content { min-height: 3.75rem; }
}

.category-browser { margin-top: 2rem; }
.category-browser h2 { margin-bottom: .8rem; }
.category-card {
  display: grid;
  gap: .45rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--surface);
  text-align: left;
  color: inherit;
}
.category-card span:last-child { color: var(--muted); font-size: .875rem; }
.category-card { text-decoration: none; }
.category-card:hover { border-color: var(--accent); }
.back-link { display: inline-block; margin-top: 1.5rem; color: var(--accent); }
.back-link:not([hidden]) + .intro { padding-top: 1.5rem; }

.thumbnail {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.category-card .thumbnail { border-radius: .5rem; margin-bottom: .25rem; }
.category-card span:first-of-type { color: var(--accent); font-size: 1.15rem; font-weight: 750; }
.card .thumbnail { border-radius: .8rem .8rem 0 0; }
