:root {
  --bg: #fff;
  --fg: #000;
  --fs-nav: 18px;
  --fs-title: 14px;
  --fs-body: 14px;
  --fs-button: 14px;
  --gap: 20px;
  --plate-offset: 3px;
  --card-min-mult: 1.25;
  --page-btn-size: 36px;
  --fs-page: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial,
    Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
}

.nav {
  border-bottom: 1px solid var(--fg);
  padding: 14px 16px;
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: var(--fs-nav);
}

.nav .chev {
  letter-spacing: 0;
  padding: 0 0.5em;
}

.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  flex: 1;
}

.controls {
  display: flex;
  gap: var(--gap);
  align-items: center;
  margin-bottom: var(--gap);
  flex-wrap: wrap;
}

.search,
.filter {
  border: 1px solid var(--fg);
  background: #fff;
  color: #000;
  padding: 10px 12px;
  height: 42px;
  outline: none;
}

.search {
  flex: 1 1 320px;
}

.filter {
  flex: 0 0 220px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
  :root {
    --card-min-mult: 1.2;
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  :root {
    --card-min-mult: 1.15;
  }
}

@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }
  :root {
    --card-min-mult: 1.1;
  }
}

@media (max-width: 720px) and (orientation: landscape) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card.ghost {
  position: relative;
}

.card.ghost > .plate {
  background: transparent !important;
}

.card.ghost > .content {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.25);
  aspect-ratio: 4/5;
  padding: 16px;
  display: block;
  min-height: calc(100cqi * var(--card-min-mult));
}

.card.ghost:hover > .content,
.card.ghost:hover > .plate {
  transform: none;
  background: transparent;
}

.card.ghost .icon,
.card.ghost h4,
.card.ghost p,
.card.ghost .actions,
.card.ghost .state {
  display: none !important;
}

.card {
  position: relative;
  container-type: inline-size;
}

.card > .plate {
  position: absolute;
  inset: calc(-1 * var(--plate-offset));
  background: transparent;
  z-index: 0;
  transition: background 0.15s ease;
}

.card > .content {
  position: relative;
  z-index: 1;
  background: #fff;
  border: 1px solid var(--fg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  aspect-ratio: 4/5;
  transition: transform 0.15s ease;
  min-height: calc(100cqi * var(--card-min-mult));
}

.card:hover > .plate {
  background: #000;
}

.icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
}

.icon svg {
  width: 24px;
  height: 24px;
  display: block;
  color: var(--fg);
}

.content h4 {
  font-size: var(--fs-title);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.content p {
  font-size: var(--fs-body);
  flex: 1;
}

.state {
  margin-top: 6px;
  font-size: var(--fs-body);
  font-style: italic;
}

.actions {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.actions.one {
  grid-template-columns: 1fr;
}

.actions.two {
  grid-template-columns: 1fr 1fr;
}

a.custom-btn,
button.custom-btn {
  position: relative;
  width: 100%;
  height: 42px;
  cursor: pointer;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 0;
  overflow: hidden;
  font-size: var(--fs-button);
  text-decoration: none;
  display: inline-block;
}

.act-btn {
  line-height: 42px;
  padding: 0;
}

.act-btn span {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  text-align: center;
}

.act-btn:before,
.act-btn:after {
  position: absolute;
  content: "";
  height: 0%;
  width: 2px;
  background: #000;
}

.act-btn:before {
  right: 0;
  top: 0;
  transition: all 500ms ease;
}

.act-btn:after {
  left: 0;
  bottom: 0;
  transition: all 500ms ease;
}

.act-btn:hover {
  color: #000;
  background: transparent;
}

.act-btn:hover:before {
  height: 100%;
}

.act-btn:hover:after {
  height: 100%;
}

.act-btn span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.act-btn span:before,
.act-btn span:after {
  position: absolute;
  content: "";
  background: #000;
}

.act-btn span:before {
  left: 0;
  top: 0;
  width: 0%;
  height: 2px;
  transition: all 500ms ease;
}

.act-btn span:after {
  right: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  transition: all 500ms ease;
}

.act-btn span:hover:before {
  width: 100%;
}

.act-btn span:hover:after {
  width: 100%;
}

.act-btn .ico {
  display: inline-flex;
  width: 1.3em;
  height: 5em;
  margin-right: 0.5em;
  vertical-align: -0.125em;
}
.act-btn .ico svg { width: 1.3em; height: 1.3em; display: block; }

.act-btn .ico svg,
.act-btn .ico svg * {
  fill: currentColor;
  stroke: currentColor;
}

a.custom-btn.act-btn:focus-visible,
button.custom-btn.act-btn:focus-visible {
  outline: 2px dashed #000;
  outline-offset: 4px;
}

.dev-btn {
  background: transparent;
  color: #000;
  border: 2px dotted #000;
  line-height: 42px;
  text-align: center;
  cursor: default;
}

.dev-btn span {
  display: block;
  width: 100%;
  height: 100%;
}

.dev-btn:before,
.dev-btn:after,
.dev-btn span:before,
.dev-btn span:after {
  display: none !important;
}

.page::after {
  content: "";
  display: block;
  height: 60px;
}

.pagination {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 26px;
  flex-wrap: wrap;
}

.page-btn {
  width: var(--page-btn-size);
  height: var(--page-btn-size);
  display: inline-grid;
  place-items: center;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font-weight: 700;
  font-size: var(--fs-page);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  border-radius: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.page-btn.is-active {
  background: #000;
  color: #fff;
}

.page-btn:hover:not(.is-active):not([disabled]) {
  background: #000;
  color: #fff;
}

.page-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-btn:focus-visible {
  outline: 2px dashed #000;
  outline-offset: 4px;
}
