/* =========================================================
   TicoLibre — biblioteca de enlaces
   Editorial shell: warm paper, serif display, crimson accent.
   ========================================================= */

:root {
  --bg: #fbfaf7;
  --bg-soft: #f5f1ea;
  --header-bg: rgba(251, 250, 247, 0.84);
  --surface: #ffffff;
  --surface-2: #f4f0e9;
  --surface-3: #ebe4da;
  --border: #e7e0d6;
  --border-strong: #d4c9ba;
  --text: #17130f;
  --muted: #6b6258;
  --muted-2: #7c7265;
  --accent: #d93a4f;
  --accent-strong: #b3253a;
  --accent-soft: rgba(217, 58, 79, 0.09);
  --accent-line: rgba(217, 58, 79, 0.28);
  --ring: rgba(217, 58, 79, 0.22);
  --ochre: rgba(190, 141, 66, 0.1);
  --shadow-sm: 0 1px 2px rgba(38, 28, 18, 0.04);
  --shadow-md: 0 2px 6px rgba(38, 28, 18, 0.04), 0 20px 40px -26px rgba(38, 28, 18, 0.4);
  --shadow-lg: 0 30px 70px -32px rgba(38, 28, 18, 0.5);
  --radius: 18px;
  --radius-sm: 12px;
  --font-sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --maxw: 1160px;
}

html[data-theme="dark"] {
  --bg: #0c0b0a;
  --bg-soft: #141210;
  --header-bg: rgba(12, 11, 10, 0.84);
  --surface: #151311;
  --surface-2: #1d1a17;
  --surface-3: #272320;
  --border: #2a2521;
  --border-strong: #3b342e;
  --text: #f4efe8;
  --muted: #a89d90;
  --muted-2: #8f8578;
  --accent: #ff6376;
  --accent-strong: #ff8595;
  --accent-soft: rgba(255, 99, 118, 0.12);
  --accent-line: rgba(255, 99, 118, 0.34);
  --ring: rgba(255, 99, 118, 0.3);
  --ochre: rgba(206, 158, 84, 0.08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.35), 0 24px 48px -28px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 34px 80px -34px rgba(0, 0, 0, 0.95);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
  scroll-behavior: smooth;
}
html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 480px at 8% -12%, var(--accent-soft), transparent 62%),
    radial-gradient(760px 420px at 92% -6%, var(--ochre), transparent 66%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

main { flex: 1 0 auto; position: relative; z-index: 1; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 550;
  text-decoration: none;
  transition: top 0.18s var(--ease);
}
.skip-link:focus-visible { top: 12px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(150%) blur(18px);
  -webkit-backdrop-filter: saturate(150%) blur(18px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.025em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(150deg, #f0606f, var(--accent-strong));
  box-shadow: 0 8px 18px -9px var(--accent-line), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.brand-mark svg { width: 17px; height: 17px; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }

.search-wrap {
  position: relative;
  flex: 1 1 240px;
  max-width: 380px;
  min-width: 150px;
  margin-left: auto;
}

.search-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-wrap input::placeholder { color: var(--muted-2); }
.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}

.clear-btn {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.clear-btn:hover { background: var(--surface-3); color: var(--text); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.icon-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease),
    background 0.16s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .i-sun { display: none; }
html[data-theme="dark"] .icon-btn .i-sun { display: block; }
html[data-theme="dark"] .icon-btn .i-moon { display: none; }

.menu-btn { display: none; }

/* ---------- chips ---------- */

.chips-row { padding: 0 0 13px; }

.categories {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
  -webkit-overflow-scrolling: touch;
}
.categories::-webkit-scrollbar { display: none; }
.categories.is-scrollable {
  mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease),
    background 0.16s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }

.chip-count {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted-2);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.45;
}

.chip-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.chip[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
}
.chip[aria-pressed="true"] .chip-count {
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
}
html[data-theme="dark"] .chip[aria-pressed="true"] .chip-count {
  background: rgba(0, 0, 0, 0.24);
}

/* ---------- menu ---------- */

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(12, 9, 6, 0.45);
  backdrop-filter: blur(3px);
  animation: fade 0.18s var(--ease);
}

.menu-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 49;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: drop 0.22s var(--ease);
  max-height: calc(100vh - 68px);
  overflow-y: auto;
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.menu-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 48px;
  padding: 20px 24px 26px;
}

.menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 2px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.16s var(--ease);
}
.menu-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--muted-2);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}
.menu-link:hover { color: var(--accent); }
.menu-link:hover svg { color: var(--accent); transform: translate(2px, -2px); }

/* ---------- hero ---------- */

.hero { padding: clamp(52px, 7.5vw, 92px) 0 0; max-width: 900px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.hero h1 {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.9rem, 1.4rem + 6vw, 5.1rem);
  line-height: 0.94;
  letter-spacing: -0.02em;
}
.hero h1 em { font-style: italic; color: var(--accent); }

.hero-sub {
  margin: 22px 0 0;
  max-width: 56ch;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 44px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--border);
}
.stats > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: clamp(26px, 4.5vw, 58px);
  margin-right: clamp(26px, 4.5vw, 58px);
  border-right: 1px solid var(--border);
}
.stats > div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.stats dt {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.stats dd {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}

/* ---------- list head ---------- */

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: clamp(44px, 6vw, 74px) 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 148px;
}
.list-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.55rem, 1.1rem + 1.4vw, 1.95rem);
  line-height: 1.1;
  letter-spacing: -0.012em;
  outline: none;
}
.list-head h2:focus-visible {
  border-radius: 4px;
  box-shadow: 0 0 0 3px var(--ring);
}
.count {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

/* ---------- grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(302px, 1fr));
  gap: 16px;
  padding-bottom: 36px;
  scroll-margin-top: 148px;
}

@keyframes rise {
  from { opacity: 0; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  min-width: 0;
  animation: rise 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 20ms);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease),
    border-color 0.22s var(--ease);
}

/* Warm glow that fades in behind the card content on hover. */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 90% at 100% 0%, var(--accent-soft), transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease);
}

.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
}
.card:hover::after,
.card:focus-visible::after { opacity: 1; }

.card-arrow {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 1;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.card-arrow svg { width: 14px; height: 14px; }
.card:hover .card-arrow,
.card:focus-visible .card-arrow { opacity: 1; transform: none; }

.card-top {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding-right: 28px;
}

.favicon {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  display: grid;
  place-items: center;
}

.favicon img {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}
.favicon img.is-broken { display: none; }

.favicon-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
}

.card-domain {
  font-size: 0.75rem;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.card-title {
  margin: 0;
  font-size: 1.0313rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.018em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  margin: 0;
  font-size: 0.8438rem;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc:empty { display: none; }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-cat .cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-cat .dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
}

.card-date {
  flex: 0 0 auto;
  font-size: 0.7rem;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

mark {
  background: var(--accent-soft);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* ---------- pagination ---------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0 78px;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease),
    background 0.16s var(--ease), transform 0.16s var(--ease);
}
.page-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.page-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.page-btn svg { width: 14px; height: 14px; }
.page-btn[aria-current="page"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.page-btn.is-direction { padding: 0 14px; }
.page-gap {
  padding: 0 2px;
  color: var(--muted-2);
  font-size: 0.8125rem;
  user-select: none;
}

/* ---------- states ---------- */

.empty {
  text-align: center;
  padding: 76px 20px 110px;
  color: var(--muted);
}
.empty-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted-2);
}
.empty-icon svg { width: 20px; height: 20px; }
.empty h3 { margin: 0 0 6px; font-size: 1.0625rem; color: var(--text); letter-spacing: -0.01em; }
.empty p { margin: 0; font-size: 0.875rem; }

.status {
  display: none;
  padding: 14px 16px;
  margin: 0 0 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8438rem;
  line-height: 1.6;
}
.status.is-visible { display: block; }
.status.is-error {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
}
.status code,
.dialog code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  border-radius: 5px;
  padding: 1px 5px;
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}

.footer-inner {
  display: flex;
  justify-content: center;
  padding-top: 34px;
  padding-bottom: 42px;
}

.footer-credit {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted-2);
}

.heart {
  width: 14px;
  height: 14px;
  color: var(--accent);
  animation: beat 3.4s var(--ease) infinite;
}
@keyframes beat {
  0%, 72%, 100% { transform: scale(1); }
  78% { transform: scale(1.18); }
  84% { transform: scale(0.98); }
  90% { transform: scale(1.07); }
}

.footer-author { color: var(--text); font-weight: 600; }

/* ---------- dialog ---------- */

.dialog {
  width: min(530px, calc(100vw - 32px));
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.dialog::backdrop {
  background: rgba(12, 9, 6, 0.5);
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.dialog h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}
.dialog-close { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; }
.dialog-text {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--muted);
}
.dialog-foot { display: flex; justify-content: flex-end; margin-top: 22px; }

.btn {
  height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.16s var(--ease);
}
.btn:hover { opacity: 0.88; }

/* ---------- focus ---------- */

.chip:focus-visible,
.icon-btn:focus-visible,
.card:focus-visible,
.clear-btn:focus-visible,
.nav-link:focus-visible,
.menu-link:focus-visible,
.page-btn:focus-visible,
.btn:focus-visible,
.dialog-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
  border-color: var(--accent);
}
.nav-link:focus-visible,
.menu-link:focus-visible {
  box-shadow: inset 0 0 0 2px var(--ring);
  border-radius: 8px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
  .search-wrap { max-width: none; }
  .menu-panel { max-height: calc(100vh - 68px); }
}

@media (max-width: 720px) {
  .wrap { padding: 0 17px; }
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .brand { margin-right: auto; }
  .header-tools { order: 2; }
  .search-wrap { order: 3; flex: 1 0 100%; margin-left: 0; }
  .chips-row { padding-bottom: 11px; }
  .menu-panel { max-height: calc(100vh - 124px); }

  .hero { padding-top: 40px; }
  .hero-sub { font-size: 0.9375rem; }
  .stats { margin-top: 34px; gap: 18px 0; }
  .stats > div { padding-right: 22px; margin-right: 22px; }

  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 18px; }
  .pagination { padding-bottom: 60px; }
  .menu-inner { grid-template-columns: 1fr; gap: 0; padding: 16px 17px 20px; }
  .menu-link { font-size: 1.2rem; }
}

@media (max-width: 520px) {
  .hero h1 { font-size: clamp(2.55rem, 11vw, 3.4rem); }
  .list-head { margin-top: 42px; }
  .page-btn.is-direction span { display: none; }
  .page-btn.is-direction { padding: 0 10px; }
  .footer-inner { padding-top: 28px; padding-bottom: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .card:hover { transform: none; }
  .page-btn:hover:not(:disabled) { transform: none; }
}
