:root {
  color-scheme: light;
  font-family:
    Inter,
    "Noto Sans JP",
    "Yu Gothic UI",
    system-ui,
    -apple-system,
    sans-serif;
  color: #18201d;
  background: #eeeae2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, transparent 50%, rgb(30 48 40 / 2%) 50%) 0 0 / 2rem 2rem,
    #f4f1ea;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 10;
  padding: 0.75rem 1rem;
  color: white;
  background: #17201d;
  transform: translateY(-110%);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  margin: -1px;
  border: 0;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-header,
footer,
main {
  width: min(76rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header,
footer,
.site-header nav,
.shelf-title,
.shelf-controls,
.filter-row,
.card-title,
.tool-card ul {
  display: flex;
  align-items: center;
}

.site-header {
  min-height: 4rem;
  justify-content: space-between;
  border-bottom: 1px solid rgb(23 32 29 / 12%);
}

.site-header nav {
  gap: 1rem;
  font-size: 0.82rem;
}

.brand {
  font-weight: 850;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.nav-cta {
  min-height: 2.35rem;
  padding: 0.55rem 0.85rem;
  color: white;
  background: #203b31;
  border-radius: 0.55rem;
  font-weight: 800;
  text-decoration: none;
}

.shelf-shell {
  padding-block: 2rem 5rem;
}

.shelf-heading {
  display: grid;
  min-height: 4.5rem;
  padding: 0.25rem 0.2rem 1rem;
  align-items: end;
  grid-template-columns: 7.5rem 1fr;
}

.eyebrow {
  margin: 0;
  color: #a64a22;
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.shelf-title {
  justify-content: space-between;
  gap: 1.5rem;
}

h1,
h2,
p {
  max-width: 46rem;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(1.45rem, 2.3vw, 1.85rem);
  line-height: 1.2;
}

.shelf-title p {
  margin: 0;
  color: #66716c;
  font-size: 0.83rem;
}

.shelf-controls {
  position: sticky;
  z-index: 4;
  top: 0;
  min-height: 4.5rem;
  padding: 0.7rem;
  gap: 0.75rem;
  background: rgb(250 248 243 / 92%);
  border: 1px solid rgb(23 32 29 / 12%);
  border-radius: 0.9rem;
  box-shadow: 0 0.8rem 2rem rgb(39 35 25 / 8%);
  backdrop-filter: blur(14px);
}

.search-control {
  position: relative;
  display: flex;
  width: min(19rem, 100%);
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.8rem;
  color: #6f7874;
  font-size: 1.2rem;
  pointer-events: none;
}

.search-control input {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.65rem 0.8rem 0.65rem 2.35rem;
  color: #18201d;
  background: white;
  border: 1px solid #ccd1ce;
  border-radius: 0.62rem;
}

.filter-row {
  overflow-x: auto;
  gap: 0.4rem;
  scrollbar-width: thin;
}

.filter-row button {
  min-height: 2.55rem;
  padding-inline: 0.85rem;
  color: #47524d;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.filter-row button:hover {
  background: #ece9e2;
}

.filter-row button[aria-pressed="true"] {
  color: white;
  background: #203b31;
}

#tool-count {
  margin-left: auto;
  color: #6f7874;
  font-size: 0.72rem;
  white-space: nowrap;
}

.tool-grid {
  display: grid;
  padding-top: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tool-card {
  min-width: 0;
  overflow: hidden;
  background: rgb(255 255 255 / 86%);
  border: 1px solid rgb(23 32 29 / 12%);
  border-radius: 1rem;
  box-shadow: 0 0.6rem 1.8rem rgb(39 35 25 / 5%);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.tool-card:hover {
  border-color: rgb(32 59 49 / 35%);
  box-shadow: 0 1rem 2.4rem rgb(39 35 25 / 10%);
  transform: translateY(-2px);
}

.tool-card[hidden] {
  display: none;
}

.tool-card > a {
  display: grid;
  height: 100%;
  text-decoration: none;
  grid-template-columns: minmax(12rem, 0.92fr) minmax(0, 1.08fr);
}

.tool-card figure {
  position: relative;
  min-height: 15rem;
  overflow: hidden;
  margin: 0;
  background: #e4e8e3;
  border-right: 1px solid rgb(23 32 29 / 9%);
}

.tool-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 220ms ease;
}

.tool-card:hover img {
  transform: scale(1.018);
}

.tool-card figcaption {
  position: absolute;
  inset: auto auto 0.7rem 0.7rem;
  padding: 0.45rem 0.65rem;
  color: white;
  background: rgb(23 32 29 / 90%);
  border-radius: 0.42rem;
  font-size: 0.68rem;
  font-weight: 850;
  box-shadow: 0 0.25rem 0.8rem rgb(0 0 0 / 18%);
}

.card-body {
  display: flex;
  min-width: 0;
  padding: 1.1rem;
  flex-direction: column;
}

.card-title {
  justify-content: space-between;
  gap: 1rem;
}

.card-title h2 {
  font-size: 1rem;
}

.card-title > span {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  color: #345e4e;
  background: #e6eee9;
  border-radius: 50%;
  font-weight: 900;
  place-items: center;
}

.card-body > p {
  margin: 0.8rem 0 1rem;
  color: #59635e;
  font-size: 0.78rem;
  line-height: 1.7;
}

.tool-card ul {
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: auto 0 0;
  list-style: none;
}

.tool-card li {
  padding: 0.3rem 0.5rem;
  color: #5c665f;
  background: #f0eee8;
  border-radius: 0.35rem;
  font-size: 0.64rem;
  font-weight: 750;
}

.empty-result {
  padding: 5rem 1rem;
  margin: 1rem 0 0;
  color: #69736e;
  background: rgb(255 255 255 / 70%);
  border: 1px dashed #bcc3bf;
  border-radius: 1rem;
  text-align: center;
}

.prose {
  margin-block: 3rem 6rem;
  padding: clamp(1.5rem, 5vw, 3rem);
  background: rgb(255 255 255 / 78%);
  border: 1px solid rgb(23 32 29 / 10%);
  border-radius: 1rem;
}

.prose h1 {
  margin-bottom: 1.5rem;
}

.prose h2 {
  margin-top: 2rem;
  font-size: 1rem;
}

.prose p {
  font-size: 0.9rem;
  line-height: 1.85;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #eaa12d;
  outline-offset: 3px;
}

footer {
  min-height: 5rem;
  justify-content: space-between;
  color: #59645f;
  border-top: 1px solid rgb(23 32 29 / 12%);
  font-size: 0.8rem;
}

footer nav {
  display: flex;
  gap: 1rem;
}

@media (max-width: 62rem) {
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card > a {
    grid-template-columns: minmax(15rem, 0.9fr) minmax(0, 1.1fr);
  }

  .shelf-controls {
    flex-wrap: wrap;
  }

  .filter-row {
    order: 3;
    width: 100%;
  }
}

@media (max-width: 38rem) {
  .shelf-heading {
    gap: 0.45rem;
    grid-template-columns: 1fr;
  }

  .shelf-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .search-control {
    width: calc(100% - 3rem);
  }

  .tool-card > a {
    grid-template-columns: 1fr;
  }

  .tool-card figure {
    min-height: 13rem;
    border-right: 0;
    border-bottom: 1px solid rgb(23 32 29 / 9%);
  }

  footer {
    padding-block: 1.5rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tool-card,
  .tool-card img {
    transition: none;
  }
}
