:root {
  --ink: #273432;
  --muted: #6d7772;
  --paper: #f4f0e6;
  --paper-light: #fbf8f1;
  --blue: #6f8f8b;
  --blue-dark: #314945;
  --wood: #6b4d3d;
  --wood-dark: #443127;
  --wine: #854c58;
  --ochre: #b08a4a;
  --line: rgba(49, 73, 69, .17);
  --shadow: 0 18px 45px rgba(48, 38, 29, .10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 15%, rgba(176, 138, 74, .06), transparent 30%),
    var(--paper);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  line-height: 1.8;
}

button, input { font: inherit; }

a { color: inherit; }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: .6rem 1rem;
  color: white;
  background: var(--blue-dark);
  transform: translateY(-180%);
}

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

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

.hero {
  min-height: 430px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: #f8f4e9;
  background:
    linear-gradient(rgba(34, 52, 49, .91), rgba(34, 52, 49, .95)),
    repeating-linear-gradient(90deg, transparent 0 78px, rgba(255,255,255,.035) 79px 80px),
    var(--blue-dark);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(244, 240, 230, .1);
  border-radius: 50%;
}

.hero::before { left: -130px; top: -160px; }
.hero::after { right: -150px; bottom: -170px; }

.hero__inner {
  max-width: 760px;
  padding: 4.5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  margin: 0 0 .7rem;
  color: var(--ochre);
  font-family: Georgia, "Times New Roman", serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .24em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  font-weight: 500;
  letter-spacing: .16em;
  text-indent: .16em;
}

.hero__lead {
  margin: 1.6rem 0 0;
  color: rgba(248, 244, 233, .82);
  font-size: clamp(.96rem, 2vw, 1.1rem);
  letter-spacing: .09em;
}

.hero__seed {
  width: 42px;
  height: 54px;
  margin: 1.4rem auto 0;
  position: relative;
}

.stem {
  position: absolute;
  bottom: 0;
  left: 20px;
  width: 1px;
  height: 32px;
  background: rgba(244, 240, 230, .7);
}

.leaf {
  position: absolute;
  width: 18px;
  height: 10px;
  border: 1px solid rgba(244, 240, 230, .65);
  border-radius: 100% 0 100% 0;
}

.leaf--one { left: 4px; top: 13px; transform: rotate(14deg); }
.leaf--two { right: 2px; top: 4px; transform: scaleX(-1) rotate(10deg); }

main { max-width: 1180px; margin: 0 auto; padding: 0 2rem; }

.welcome {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  padding: 5rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
}

.welcome h2,
.catalog h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-weight: 500;
  letter-spacing: .04em;
}

.welcome p:not(.section-kicker) { margin: .7rem 0 0; color: var(--muted); }

.note-link {
  flex: 0 0 auto;
  padding: .45rem 0;
  border-bottom: 1px solid var(--blue-dark);
  text-decoration: none;
  font-size: .9rem;
}

.note-link:hover { color: var(--wine); border-color: var(--wine); }

.shelves { padding: 2.8rem 0 5rem; }

.shelf-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.shelf-card {
  min-width: 0;
  padding: 1.25rem 1rem 1.05rem;
  text-align: left;
  color: var(--ink);
  background: rgba(251, 248, 241, .62);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.shelf-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(62, 45, 35, .1); }
.shelf-card:focus-visible { outline: 3px solid rgba(111, 143, 139, .45); outline-offset: 3px; }
.shelf-card.is-active { color: white; background: var(--blue-dark); box-shadow: var(--shadow); }

.shelf-card__books {
  height: 52px;
  display: flex;
  align-items: end;
  gap: 4px;
  margin-bottom: 1rem;
  padding-bottom: 5px;
  border-bottom: 5px solid var(--wood-dark);
}

.shelf-card__books i { display: block; width: 18%; border-radius: 2px 2px 0 0; }
.shelf-card__books i:nth-child(1) { height: 37px; background: var(--blue); }
.shelf-card__books i:nth-child(2) { height: 45px; background: var(--wine); }
.shelf-card__books i:nth-child(3) { height: 31px; background: var(--ochre); }
.shelf-card__books i:nth-child(4) { height: 42px; background: #746b60; transform: rotate(4deg); transform-origin: bottom; }
.shelf-card__books--nursing i:nth-child(2) { background: #9e6670; }
.shelf-card__books--counseling i:nth-child(1) { background: #7b7d9e; }
.shelf-card__books--travel i:nth-child(3) { background: #9c733c; }
.shelf-card__books--life i:nth-child(4) { background: #7f8d70; }

.shelf-card.is-active .shelf-card__books { border-bottom-color: rgba(255,255,255,.75); }
.shelf-card__title { display: block; font-size: .96rem; font-weight: 700; }
.shelf-card__meta { display: block; margin-top: .2rem; color: var(--muted); font-size: .78rem; }
.shelf-card.is-active .shelf-card__meta { color: rgba(255,255,255,.7); }

.catalog {
  margin: 0 -2rem;
  padding: 5rem 2rem 5.5rem;
  background: var(--paper-light);
  box-shadow: 0 0 0 100vmax var(--paper-light);
  clip-path: inset(0 -100vmax);
}

.catalog__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.result-summary { min-height: 1.8em; margin: .45rem 0 0; color: var(--muted); font-size: .88rem; }

.catalog__tools { display: flex; gap: .7rem; align-items: center; }

.search {
  width: min(320px, 38vw);
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .68rem .85rem;
  background: white;
  border: 1px solid var(--line);
}

.search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
}

.search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: .86rem; }
.search input::placeholder { color: #929a95; }

.random-button,
.empty-state button {
  padding: .68rem 1rem;
  color: white;
  background: var(--blue-dark);
  border: 1px solid var(--blue-dark);
  cursor: pointer;
  font-size: .82rem;
  white-space: nowrap;
}

.random-button:hover,
.empty-state button:hover { background: var(--wine); border-color: var(--wine); }

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.article-card {
  min-height: 245px;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 1.55rem 1.45rem 1.35rem 1.7rem;
  text-decoration: none;
  background: white;
  border: 1px solid rgba(49, 73, 69, .13);
  border-left: 6px solid var(--category-color, var(--blue));
  box-shadow: 0 5px 18px rgba(45, 38, 31, .055);
  transition: transform .2s ease, box-shadow .2s ease;
}

.article-card::before {
  content: "";
  position: absolute;
  inset: 7px 7px 7px auto;
  width: 1px;
  background: rgba(49, 73, 69, .09);
}

.article-card:hover { transform: translateY(-4px); box-shadow: 0 15px 30px rgba(45, 38, 31, .1); }
.article-card:focus-visible { outline: 3px solid rgba(111, 143, 139, .5); outline-offset: 3px; }

.article-card__category {
  margin: 0 0 .8rem;
  color: var(--category-color, var(--blue));
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .15em;
}

.article-card h3 { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.65; }
.article-card__description { margin: .75rem 0 1.2rem; color: var(--muted); font-size: .85rem; line-height: 1.75; }
.article-card__open { margin-top: auto; font-size: .76rem; color: var(--blue-dark); }

.empty-state { padding: 5rem 1rem; text-align: center; color: var(--muted); }
.empty-state p { margin: 0 0 1rem; }

.closing {
  min-height: 270px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 4rem 0;
}

.closing p { margin: 0; font-size: 1rem; color: var(--muted); }
.closing p span { color: var(--ink); font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: .08em; }
.closing a { text-decoration: none; padding-bottom: .25rem; border-bottom: 1px solid var(--blue-dark); font-size: .86rem; }
.closing a:hover { color: var(--wine); border-color: var(--wine); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem max(2rem, calc((100vw - 1180px) / 2));
  color: rgba(255,255,255,.65);
  background: var(--wood-dark);
  font-size: .72rem;
  letter-spacing: .06em;
}

footer p { margin: 0; }

@media (max-width: 900px) {
  .shelf-tabs { grid-template-columns: repeat(3, 1fr); }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog__head { align-items: start; flex-direction: column; }
  .catalog__tools { width: 100%; }
  .search { flex: 1; width: auto; }
}

@media (max-width: 620px) {
  .hero { min-height: 390px; }
  main { padding: 0 1.1rem; }
  .welcome { align-items: start; flex-direction: column; padding-top: 3.5rem; }
  .shelves { padding-bottom: 3.5rem; }
  .shelf-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .shelf-card:first-child { grid-column: 1 / -1; }
  .catalog { margin-inline: -1.1rem; padding: 3.8rem 1.1rem 4rem; }
  .catalog__tools { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .article-grid { grid-template-columns: 1fr; }
  .article-card { min-height: 215px; }
  .closing { align-items: start; flex-direction: column; justify-content: center; }
  footer { flex-direction: column; padding-inline: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
