@font-face {
  font-family: "Azeret Mono";
  src: url("/fonts/azeret.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --paper: #E8E0C9;
  --slip: #F7F2E4;
  --wrap: #E0D8C4;
  --ink: #161410;
  --muted: #7A7368;
  --red: #C51D1A;
  --gold: #B8860B;
  --font: "Azeret Mono", ui-monospace, monospace;
  --pad: 20px;
  --max: 920px;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-weight: 450;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.02em;
}
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus { outline: none; }
:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 40%, transparent); }
.skip {
  position: absolute; left: 12px; top: -40px;
  background: var(--ink); color: var(--slip); padding: 8px 12px;
}
.skip:focus { top: 12px; }
.wrap { width: min(var(--max), 100% - 2 * var(--pad)); margin-inline: auto; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 8px;
}
.mark {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 700; font-size: 18px; color: var(--ink);
}
.mark svg { width: 36px; height: 36px; display: block; }
.top .priv { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }
.top .priv:hover { color: var(--ink); }


.hero { padding: 16px 0 4px; }
.hero .lead { margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); }
.hero-swap {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 12px;
}
.hero-ic {
  width: 56px; height: 56px; object-fit: contain;
  background: var(--slip); border-radius: 14px;
  padding: 8px;
}
.hero-ic.oss { width: 72px; height: 72px; border-radius: 18px; padding: 8px; background: var(--slip); }
.hero-arrow {
  width: 22px; height: 2px; background: var(--red); position: relative; flex: none;
}
.hero-arrow::after {
  content: ""; position: absolute; right: -1px; top: 50%;
  width: 8px; height: 8px;
  border-inline-end: 2px solid var(--red);
  border-top: 2px solid var(--red);
  transform: translateY(-50%) rotate(45deg);
}
.hero h1, .hero .swap {
  margin: 0;
  font-size: clamp(26px, 7vw, 40px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.05em;
}
.hero .of {
  color: var(--muted);
  font-weight: 500;
  font-size: clamp(16px, 4vw, 20px);
  letter-spacing: -0.04em;
}
.hero .paid {
  position: relative;
  display: inline-block;
  color: var(--muted);
  font-weight: 500;
  font-size: clamp(16px, 4vw, 20px);
  letter-spacing: -0.04em;
}
.hero .paid .line {
  position: absolute; left: -2%; top: 52%;
  width: 104%; height: 0.12em;
  background: var(--red);
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
  border-radius: 1px;
}
.hero.is-in .paid .line { transform: scaleX(1); transition: transform 220ms ease-out; }
.hero .stand {
  display: block; margin-top: 2px;
  opacity: 0; transform: translateY(8px);
}
.hero.is-in .stand {
  opacity: 1; transform: none;
  transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1) 60ms,
              transform 280ms cubic-bezier(0.22, 1, 0.36, 1) 60ms;
}
.hero .count, .hero .intro {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  max-width: 46ch;
}

.tools { padding: 14px 0 4px; display: grid; gap: 8px; }
.search {
  width: 100%; min-height: 44px;
  padding: 10px 14px;
  background: var(--slip);
  color: var(--ink);
  font: inherit; font-weight: 500; font-size: 16px;
  border: 0; border-radius: 8px;
}
.search::placeholder { color: var(--muted); }
.chips, .sorts {
  display: flex; flex-wrap: nowrap; gap: 6px; align-items: center;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-inline: calc(-1 * var(--pad));
  padding-inline: var(--pad);
}
.chips::-webkit-scrollbar, .sorts::-webkit-scrollbar { display: none; }
.chip, .sort {
  min-height: 40px; padding: 0 12px; flex: none;
  background: var(--wrap); color: var(--ink);
  font: inherit; font-weight: 500; font-size: 13px;
  border: 0; border-radius: 8px; cursor: pointer;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), background 160ms ease, color 160ms ease;
}
.chip[aria-pressed="true"], .chip.is-on {
  background: var(--red); color: var(--slip);
}
.sort[aria-pressed="true"] { background: var(--ink); color: var(--slip); }
.sorts .lab { color: var(--muted); font-size: 13px; font-weight: 500; flex: none; }
.meta { color: var(--muted); font-size: 13px; font-weight: 500; min-height: 18px; }

.stack { display: grid; gap: 6px; padding: 8px 0 36px; }
 .row {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--slip); color: inherit;
  padding: 10px 12px; min-height: 64px;
  border: 0; border-radius: 0;
  font: inherit; cursor: pointer;
  opacity: 0; transform: translateY(10px) scale(0.98);
}
.row.is-in {
  opacity: 1; transform: none;
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
@media (hover: hover) {
  .row.is-in { transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1), background 160ms ease; }
  .row.is-in:hover { transform: scale(1.02); }
}
.row:active, .chip:active, .btn:active, .sort:active { transform: scale(0.97); }
.swap-ic { display: flex; align-items: center; gap: 6px; flex: none; }
.ic {
  width: 36px; height: 36px; object-fit: contain;
  background: var(--paper); border-radius: 10px; padding: 5px;
}
.ic.oss { width: 40px; height: 40px; border-radius: 11px; background: #fff; padding: 5px; }
.arr {
  width: 10px; height: 2px; background: var(--red); position: relative; flex: none;
}
.arr::after {
  content: ""; position: absolute; right: -1px; top: 50%;
  width: 5px; height: 5px;
  border-inline-end: 2px solid var(--red);
  border-top: 2px solid var(--red);
  transform: translateY(-50%) rotate(45deg);
}
.txt { min-width: 0; }
.row .name {
  display: block;
  font-size: 18px; line-height: 1.15; font-weight: 700; letter-spacing: -0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row .tag {
  display: block; margin-top: 2px;
  color: var(--muted); font-size: 12px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sr {
  position: absolute; left: 0; top: 0;
  width: 1px; height: 1px;
  padding: 0; margin: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.row, .stack, .wrap, main { overflow: hidden; max-width: 100%; }
html, body { overflow-x: hidden; }

.empty { padding: 28px 0 40px; color: var(--muted); }
.sheet .hero-ic { width: 48px; height: 48px; padding: 6px; }
.sheet .ids { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }

.sheet {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: flex-end; justify-content: center;
  background: color-mix(in srgb, var(--ink) 40%, transparent);
  opacity: 0; pointer-events: none; transition: opacity 200ms ease-out;
}
.sheet.is-open { opacity: 1; pointer-events: auto; }
.sheet .panel {
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  background: var(--slip); color: var(--ink);
  padding: 22px 20px 28px;
  transform: translateY(16px); transition: transform 280ms ease-out;
  border-radius: 16px 16px 0 0;
}
.sheet.is-open .panel { transform: none; }
.sheet .k { margin: 0; color: var(--muted); font-size: 13px; font-weight: 500; }
.sheet h2 { margin: 6px 0 0; font-size: 32px; line-height: 1.1; letter-spacing: -0.04em; font-weight: 700; }
.sheet p { margin: 12px 0 0; max-width: 42ch; }
.sheet .facts { margin-top: 14px; color: var(--muted); font-size: 14px; }
.sheet .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.btn {
  min-height: 44px; padding: 0 16px;
  background: var(--red); color: var(--slip);
  font: inherit; font-weight: 600; font-size: 15px;
  border: 0; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; text-decoration: none;
}
.btn.quiet { background: var(--wrap); color: var(--ink); }
.btn.close { background: var(--ink); }

.foot {
  background: var(--wrap);
  padding: 36px 0 48px;
}
.foot h2 { margin: 0; font-size: 26px; letter-spacing: -0.04em; font-weight: 700; }
.foot p { margin: 8px 0 0; max-width: 40ch; }
.grid2 { display: grid; gap: 32px; margin-top: 8px; }
form { display: grid; gap: 10px; margin-top: 16px; }
.in, .ta {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--slip); color: var(--ink);
  font: inherit; font-size: 16px; border: 0; border-radius: 8px;
}
.ta { min-height: 88px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.err { margin: 0; min-height: 1.2em; color: var(--red); font-size: 14px; }
.ok { margin: 12px 0 0; font-weight: 600; }
.credit { margin-top: 32px; color: var(--muted); font-size: 13px; }
.credit a { color: inherit; }
.credit nav { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 8px; }
.credit nav a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

@media (min-width: 800px) {
  :root { --pad: 32px; --max: 1080px; }
  .hero-ic { width: 72px; height: 72px; }
  .hero-ic.oss { width: 92px; height: 92px; }
  .chips, .sorts { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }
  .stack { grid-template-columns: 1fr 1fr; gap: 8px; }
  .grid2 { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
  .sheet { align-items: center; }
  .sheet .panel { border-radius: 0; transform: translateY(12px) scale(0.99); }
  .sheet.is-open .panel { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .hero .paid .line { transform: scaleX(1); }
  .hero .stand, .row { opacity: 1; transform: none; }
  .chip:active, .btn:active, .row:active, .row.is-in:hover { transform: none; }
}
