:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: #232620;
  background: #f8f7f2;
}

* { box-sizing: border-box; }
body { margin: 0; }
.shell { width: min(100% - 64px, 1120px); margin-inline: auto; }
.site-header { position: sticky; z-index: 2; top: 0; border-bottom: 1px solid #dfdfd5; background: #f8f7f2; }
.header-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#showcase, #apps { scroll-margin-top: 65px; }
.catalog-nav { display: flex; gap: clamp(4px, 2vw, 15px); }
.catalog-nav a { display: block; padding: 8px; border-radius: 6px; color: #454b3f; text-decoration: none; font-size: 14px; font-weight: 720; white-space: nowrap; }
.catalog-nav a:hover { background: #e8ebe0; }
.intro { padding: 39px 0 27px; }
.intro h1, .intro h2 { margin: 0; font-size: clamp(2.15rem, 5vw, 4.2rem); line-height: 1.1; letter-spacing: -.08em; }
.intro h2 { font-size: clamp(1.9rem, 4vw, 3.15rem); }
.intro p { margin: 11px 0 0; color: #56594f; line-height: 1.55; }
.app-list { list-style: none; padding: 0; margin: 0 0 44px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.app-card { height: 100%; display: block; overflow: hidden; text-decoration: none; color: inherit; background: #fffefa; border: 1px solid #dedfd4; border-radius: 12px; transition: box-shadow .18s, border-color .18s; }
.app-card:hover { border-color: #abb5a0; box-shadow: 0 7px 20px #353f3220; }
.app-card:focus-visible { outline: 2px solid #a63d28; outline-offset: 4px; }
.cover { overflow: hidden; aspect-ratio: 2.1875; background: #e6e9dc; }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover img[src$="/han-river.jpg"] { object-position: center 53%; }
.card-caption { min-height: 78px; padding: 13px 17px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-caption h2, .card-caption h3 { margin: 0; font-size: 19px; letter-spacing: -.04em; }
.archive-group-title { margin: 0 0 15px; font-size: 1.45rem; letter-spacing: -.04em; }
.card-caption p { margin: 5px 0 0; color: #56594f; line-height: 1.4; font-size: 14px; }
.card-caption span { display: grid; width: 32px; aspect-ratio: 1; flex-shrink: 0; place-items: center; border-radius: 50%; background: #eeefe6; }
.app-card:hover .card-caption span { background: #dfe7d8; }

.catalog-nav a:focus-visible, .catalog :is(input, select, button):focus-visible { outline: 2px solid #a63d28; outline-offset: 3px; }
.catalog .shell { width: min(100% - 64px, 1360px); }
.catalog .intro { padding-top: clamp(34px, 5.5vw, 72px); }
.catalog .app-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.catalog .cover { aspect-ratio: 16 / 9; }
.catalog .card-caption { padding-block: 15px 17px; }
.catalog-tags { display: block; margin: 0 0 6px; color: #545e4e; font-size: .78rem; font-weight: 700; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.catalog-search { position: relative; display: block; color: #6a5b50; }
.catalog-search::before, .catalog-search::after { position: absolute; z-index: 1; content: ''; pointer-events: none; }
.catalog-search::before { top: 19px; left: 21px; width: 13px; height: 13px; border: 1.5px solid currentColor; border-radius: 50%; }
.catalog-search::after { top: 34px; left: 33px; width: 7px; height: 1.5px; border-radius: 1px; background: currentColor; rotate: 45deg; }
.catalog-search input {
  width: 100%;
  min-height: 56px;
  padding: 10px 18px 10px 52px;
  border: 1px solid #cbc7ba;
  border-radius: 14px;
  background: #fffefa;
  color: #232620;
  font: inherit;
  box-shadow: 0 2px 6px #44301b09;
}
.catalog-search input::placeholder { color: #6e695e; }
.catalog-search input:hover, .catalog-select select:hover { border-color: #a39c8b; }
.catalog-filter-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 16px; }
.catalog-kind {
  display: flex;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 4px;
  border: 1px solid #e3dfd2;
  border-radius: 14px;
  background: #eeebe1;
}
.catalog-kind label { position: relative; }
.catalog-kind span {
  display: grid;
  min-height: 42px;
  padding-inline: 19px;
  place-items: center;
  border-radius: 9px;
  color: #514c42;
  font-size: .9rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.catalog-kind label:hover span { background: #e3ded1; }
.catalog-kind input:checked + span { background: #a63d28; color: #fffefa; box-shadow: 0 2px 4px #6d291a20; }
.catalog-kind input:focus-visible + span { outline: 2px solid #a63d28; outline-offset: 3px; }
.catalog-selects { display: grid; grid-template-columns: 170px 140px 138px; gap: 10px; }
.catalog-select { position: relative; display: grid; min-width: 0; gap: 4px; }
.catalog-select-label { padding-inline: 3px; color: #645d50; font-size: .78rem; font-weight: 700; }
.catalog-select::after {
  position: absolute;
  bottom: 22px;
  right: 17px;
  width: 7px;
  height: 7px;
  border: solid #74695d;
  border-width: 0 1.5px 1.5px 0;
  content: '';
  pointer-events: none;
  rotate: 45deg;
}
.catalog-select select {
  width: 100%;
  min-height: 46px;
  padding: 8px 38px 8px 13px;
  appearance: none;
  border: 1px solid #d6d1c4;
  border-radius: 10px;
  background: #fffefa;
  color: #232620;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
@supports (appearance: base-select) and selector(::picker(select)) {
  .catalog-select select, .catalog-select select::picker(select) { appearance: base-select; }
  .catalog-select::after { display: none; }
  .catalog-select select { padding-inline: 13px; }
  .catalog-select select::picker-icon {
    width: 7px;
    height: 7px;
    align-self: center;
    border: solid #74695d;
    border-width: 0 1.5px 1.5px 0;
    content: '';
    rotate: 45deg;
    translate: 0 -2px;
  }
  .catalog-select select:open { border-color: #a63d28; }
  .catalog-select select:open::picker-icon { rotate: 225deg; translate: 0 2px; }
  .catalog-select select::picker(select) {
    min-inline-size: max(anchor-size(width), 10rem);
    max-block-size: min(22rem, 58dvh);
    margin-block: 6px;
    padding: 5px;
    border: 1px solid #ded8ca;
    border-radius: 12px;
    background: #fffefa;
    color: #232620;
    box-shadow: 0 10px 28px #44301b20;
  }
  .catalog-select optgroup { padding: 4px 2px; color: #6a6256; font-size: .8rem; }
  .catalog-select option { min-height: 40px; padding: 7px 9px; border-radius: 7px; color: #232620; font-size: .9rem; font-weight: 500; }
  .catalog-select option:checked { background: #f2e4de; color: #83301f; font-weight: 700; }
  .catalog-select option:focus-visible, .catalog-select option:hover { background: #eeebe1; outline: 1px solid #b2a691; outline-offset: -1px; }
}
.catalog-summary:not([hidden]) { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; }
.catalog-summary p { margin: 0; color: #454b3f; font-size: .9rem; }
.catalog-summary button {
  min-height: 36px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #863724;
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
}
.catalog-summary button:hover { background: #efe2d9; }

@media (min-width: 1200px) {
  .catalog .app-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .catalog .app-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .catalog-filter-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
  .catalog-kind label { flex: 1 1 0; }
  .catalog-kind span { padding-inline: 8px; }
  .catalog-selects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .shell, .catalog .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 53px; }
  #showcase, #apps { scroll-margin-top: 54px; }
  .catalog-nav a { padding-inline: 5px; font-size: 13px; }
  .intro { padding: 28px 0 20px; }
  .app-list { grid-template-columns: 1fr; gap: 13px; }
  .catalog .app-list { grid-template-columns: 1fr; }
  .card-caption { min-height: 72px; }
}

@media (max-width: 480px) {
  .catalog-selects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-select:first-child { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
  .header-inner { gap: 6px; }
  .header-inner .brand { font-size: 18px; }
  .header-inner .brand-mark { width: 17px; margin-right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-card { transition: none; }
}
