@font-face {
  font-family: Instrument;
  src: url("/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --paper: #F3EBE0;
  --card: #FAF6F0;
  --mid: #E7DCCE;
  --ink: #1C1712;
  --mute: #6B5E52;
  --stamp: #C4351D;
  --forest: #2C5A45;
  --forest-ink: #E7F0EA;
  --stamp-ink: #FBECEA;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); color: var(--ink); font-family: Instrument, ui-sans-serif, system-ui, sans-serif; font-weight: 430; line-height: 1.4; -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
body.locked { overflow: hidden; }
a { color: inherit; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { box-shadow: 0 0 0 3px rgba(196, 53, 29, 0.4); }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 4px; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 18px; }
.mark svg { width: 32px; height: 32px; }
.suggest-link, .quiet-link { min-height: 44px; padding: 10px 14px; border-radius: 999px; background: var(--mid); display: inline-flex; align-items: center; text-decoration: none; font-weight: 530; }
.suggest-link:active, .btn:active, .pill:active, .card-hit:active { transform: scale(0.97); }

.hero, .intro { padding: 16px 0 0; }
.hero h1, .intro h1 { font-size: 28px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; max-width: 18ch; }
.search { margin-top: 14px; }
.search input {
  width: 100%; height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--card); font-size: 16px;
}
.search input::placeholder { color: var(--mute); }

.filters { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 0; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto; min-height: 44px; padding: 0 13px; border-radius: 999px;
  background: var(--mid); font-weight: 530; font-size: 14px; white-space: nowrap;
  transition: transform 160ms var(--spring), background 160ms var(--ease), color 160ms var(--ease);
}
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pill.lic[aria-pressed="true"] { background: var(--stamp); color: var(--stamp-ink); }
.pill.lic.cc0[aria-pressed="true"], .pill.lic.public[aria-pressed="true"] { background: var(--forest); color: var(--forest-ink); }
.meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 10px; color: var(--mute); font-size: 13px; min-height: 44px; }
.sort { min-height: 44px; padding: 0 4px; color: var(--ink); font-weight: 530; appearance: none; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding-bottom: 48px; }
.card { position: relative; }
.card-hit {
  display: flex; flex-direction: column; align-items: flex-start;
  width: 100%; text-align: left; padding: 14px 12px 14px;
  border-radius: var(--radius); background: var(--card);
  transform-origin: center;
  transition: transform 200ms var(--spring);
}
@media (hover: hover) {
  .card-hit:hover { transform: scale(1.03); }
}
.card-hit:active { transform: scale(0.97); transition-duration: 90ms; }
.logo-wrap { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.logo {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--mid); object-fit: contain;
}
.pick {
  position: absolute; bottom: 2px; right: 2px; width: 10px; height: 10px;
  border-radius: 99px; background: var(--stamp);
}
.card h2 { margin-top: 10px; font-size: 15px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.tag { margin-top: 2px; font-size: 12px; color: var(--mute); }
.seo {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.panel { background: var(--card); border-radius: var(--radius); padding: 24px; margin: 12px 0 48px; }
.panel h2 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.panel p, .prose p { margin-top: 10px; color: var(--mute); max-width: 52ch; }
.prose { padding: 12px 0 64px; }
.prose h1 { font-size: 36px; font-weight: 650; letter-spacing: -0.03em; }
.prose h2 { margin-top: 28px; font-size: 22px; font-weight: 650; }
.field { margin-top: 16px; }
.field span { display: block; font-size: 14px; font-weight: 530; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: 12px; background: var(--mid); font-size: 16px;
}
.field textarea { min-height: 96px; resize: vertical; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.btn {
  margin-top: 18px; min-height: 48px; padding: 0 20px; border-radius: 999px;
  background: var(--stamp); color: var(--stamp-ink); font-weight: 620;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  transition: transform 160ms var(--spring);
}
.btn.ink { background: var(--ink); color: var(--paper); }
.err { margin-top: 10px; color: var(--stamp); font-size: 14px; min-height: 1em; }
.ok { color: var(--forest); font-weight: 530; }

.foot { padding: 12px 0 48px; }
.band { background: var(--mid); border-radius: var(--radius); padding: 24px; margin-bottom: 28px; }
.band h2 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.band p { margin-top: 6px; color: var(--mute); }
.band form, .inline { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.band input { flex: 1 1 200px; height: 48px; padding: 0 16px; border-radius: 999px; background: var(--card); font-size: 16px; }
.band .btn { margin-top: 0; }
.colophon { color: var(--mute); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.colophon a { font-weight: 530; color: var(--ink); text-decoration: none; }
.empty { padding: 28px 0 64px; color: var(--mute); font-size: 16px; grid-column: 1 / -1; }

/* Detail sheet */
.sheet { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.sheet.open { pointer-events: auto; }
.backdrop { position: absolute; inset: 0; background: rgba(28, 23, 18, 0.4); opacity: 0; transition: opacity 200ms var(--ease); }
.sheet.open .backdrop { opacity: 1; }
.drawer {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: min(86dvh, 720px); overflow: auto;
  background: var(--paper); border-radius: 24px 24px 0 0;
  padding: 20px 20px 32px;
  transform: translateY(110%);
  transition: transform 280ms var(--ease);
}
.sheet.open .drawer { transform: none; }
.sheet-handle { width: 36px; height: 4px; border-radius: 99px; background: var(--mid); margin: 0 auto 16px; }
.sheet-close {
  position: absolute; top: 16px; right: 16px; min-width: 44px; min-height: 44px;
  border-radius: 99px; background: var(--mid); font-weight: 530;
}
.drawer .logo { width: 72px; height: 72px; border-radius: 20px; background: var(--mid); }
.drawer h2 { margin-top: 16px; font-size: 28px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; padding-right: 56px; }
.drawer .tag { margin-top: 6px; font-size: 14px; color: var(--mute); }
.drawer .desc { margin-top: 14px; font-size: 16px; max-width: 42ch; }
.drawer .facts { margin-top: 10px; font-size: 14px; color: var(--mute); }
.drawer .btn { margin-top: 22px; width: 100%; }

@keyframes settle {
  from { opacity: 0; transform: translateY(10px); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: none; }
}
.card.enter { animation: settle 280ms var(--ease) both; }

@media (min-width: 800px) {
  .hero h1, .intro h1, .prose h1 { font-size: 44px; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .logo, .logo-wrap { width: 72px; height: 72px; }
  .logo { border-radius: 18px; }
  .card h2 { font-size: 16px; }
  .drawer {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(480px, calc(100% - 48px));
    max-height: min(80dvh, 640px);
    border-radius: 24px;
    transform: translate(-50%, -46%) scale(0.97);
    opacity: 0;
    transition: transform 240ms var(--ease), opacity 200ms var(--ease);
  }
  .sheet.open .drawer { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  .sheet-handle { display: none; }
  .drawer .btn { width: auto; }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card-hit:hover, .card-hit:active { transform: none; }
  .drawer, .sheet.open .drawer, .backdrop, .sheet.open .backdrop { transform: none; opacity: 1; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
