:root {
  --wall: #e4e8ee;
  --wall-2: #d6dce5;
  --wood: #b98a5a;
  --wood-dark: #8a6440;
  --text: #1b2233;
  --soft: #5a6478;
  --sky: #9dbcdd;
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--wall);
  color: var(--text);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-optical-sizing: auto;
  line-height: 1.5;
}
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--text); outline-offset: 4px; border-radius: 4px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

header.top { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; }
.logo { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em; text-decoration: none; }
header.top nav { display: flex; gap: 22px; }
header.top nav a { text-decoration: none; color: var(--soft); }
header.top nav a:hover { color: var(--text); }

.intro { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding: 8px 0 28px; flex-wrap: wrap; }
.intro h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 800; max-width: 16ch; }
.intro p { color: var(--soft); max-width: 40ch; }

/* Apps stand like books, spine out. Wrapping rows each get their own plank,
   so the shelf grows downward with the collection instead of off-screen. */
.shelf {
  --row: 300px; --plank: 18px;
  display: flex; flex-wrap: wrap; align-items: flex-end;
  column-gap: 6px; row-gap: calc(var(--plank) + 26px);
  padding: 0 14px var(--plank);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 var(--row),
    var(--wood) var(--row) calc(var(--row) + var(--plank) * .6),
    var(--wood-dark) calc(var(--row) + var(--plank) * .6) calc(var(--row) + var(--plank)),
    transparent calc(var(--row) + var(--plank)) calc(var(--row) + var(--plank) + 26px)
  );
  border-radius: 3px;
}
.spine {
  --c: #888; --ink: #fff;
  position: relative; height: var(--row);
  width: 64px; flex: none;
  background: linear-gradient(90deg, rgba(0,0,0,.12), transparent 18%, transparent 82%, rgba(0,0,0,.14)), var(--c);
  color: var(--ink); text-decoration: none;
  border-radius: 5px 5px 2px 2px;
  overflow: hidden;
  transition: width .4s cubic-bezier(.2, .8, .2, 1);
}
/* Every spine fills the row (so wrapped rows line up with their plank); the
   varied book heights are a clipped top margin. */
.spine:nth-child(3n+2) { clip-path: inset(22px 0 0 0 round 5px 5px 2px 2px); }
.spine:nth-child(3n) { clip-path: inset(10px 0 0 0 round 5px 5px 2px 2px); }
.spine:nth-child(3n+2) .side, .spine:nth-child(3n+2) .cover { top: 22px; }
.spine:nth-child(3n) .side, .spine:nth-child(3n) .cover { top: 10px; }

.spine .side {
  position: absolute; inset: 0 auto 0 0; width: 64px;
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 12px 0;
}
.app-icon { width: 40px; height: 40px; border-radius: 10px; display: block; flex: none; }
.app-mono {
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .28); color: inherit;
  font-weight: 800; font-size: 1.3rem;
}
.spine .title {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; white-space: nowrap;
}
.spine .cover {
  position: absolute; inset: 0 0 0 64px; width: 236px;
  padding: 20px 20px 18px 6px;
  display: flex; flex-direction: column;
  opacity: 0; transition: opacity .25s;
}
.cover .name { font-size: 1.6rem; line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; }
.cover .blurb { margin-top: 10px; font-size: .98rem; line-height: 1.4; }
.cover .meta { margin-top: auto; font-size: .85rem; display: flex; justify-content: space-between; gap: 8px; }
.cover .go { margin-top: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Pull one book out: hovered or focused, or the first one while nothing is hovered. */
.spine.open, .spine:hover, .spine:focus-visible { width: 300px; }
.spine.open .cover, .spine:hover .cover, .spine:focus-visible .cover { opacity: 1; }
.shelf:hover .spine.open:not(:hover) { width: 64px; }
.shelf:hover .spine.open:not(:hover) .cover { opacity: 0; }

.shelf-note { margin-top: 14px; color: var(--soft); font-size: .92rem; }
.fallback { padding: 20px; font-size: 1.1rem; }

.about { display: grid; grid-template-columns: 170px 1fr; gap: 32px; align-items: start; padding-top: 64px; }
.about img { width: 100%; height: auto; border-radius: 50%; display: block; aspect-ratio: 1; object-fit: cover; background: var(--sky); }
.about h2 { font-size: 1.7rem; letter-spacing: -0.03em; font-weight: 800; line-height: 1.1; }
.about p { margin-top: 10px; max-width: 64ch; }
.links { list-style: none; padding: 0; margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.links a { display: inline-block; background: var(--wall-2); border-radius: 999px; padding: 6px 16px; text-decoration: none; font-weight: 600; }
.links a:hover { background: var(--text); color: var(--wall); }

footer.bottom { padding: 56px 0 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--soft); }
footer.bottom ul { list-style: none; padding: 0; display: flex; gap: 20px; }

@media (prefers-reduced-motion: reduce) { .spine, .spine .cover { transition: none; } }

/* No hover on phones: books lie flat as a stack, every cover readable. */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .shelf { display: grid; gap: 8px; background: none; padding: 0; }
  .spine, .spine:nth-child(n), .spine.open, .spine:hover { width: 100%; height: auto; border-radius: 6px; clip-path: none; }
  .spine .side { position: static; flex-direction: row; width: auto; padding: 14px 16px 0; }
  .spine .title { display: none; }
  .spine .cover, .shelf:hover .spine.open:not(:hover) .cover { position: static; width: auto; opacity: 1; padding: 10px 16px 16px; }
  .shelf:hover .spine.open:not(:hover) { width: 100%; }
  .cover .meta { margin-top: 12px; }
  .shelf-note { display: none; }
  .about { grid-template-columns: 1fr; gap: 20px; padding-top: 48px; }
  .about img { max-width: 140px; }
}
