/* =========================================================================
   Page styles for the tools hub, the catalogue, the two ebook pages and the API docs.
   Only what these pages need: shared parts live in base, article and home.
   ========================================================================= */
@layer page {

/* ------------------------------------------------------------ tools hub */
/* Five tiles on a six-column grid: three across the top, two below at full width. */
.tools-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40rem) and (max-width: 63.99rem) {
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools-grid > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 64rem) {
  .tools-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tools-grid > .tile { grid-column: span 2; }
  .tools-grid > .tile:nth-child(n + 4) { grid-column: span 3; }
}

/* "How the tools work": four plain facts, then the two longer panels. */
.how-facts { list-style: none; padding: 0; display: grid; border-top: 1px solid var(--line); margin-bottom: clamp(2.2rem, 5vw, 3.4rem); }
.how-fact { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 0 1rem; align-items: start; padding: 1.15rem 0; border-bottom: 1px solid var(--line); }
.how-icon { width: 1.5rem; height: 1.5rem; margin-top: .1rem; color: var(--accent); }
.how-fact strong { display: block; font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.how-fact p { margin-top: .3rem; max-width: 60ch; font-size: .98rem; line-height: 1.55; color: var(--ink-2); }
@media (min-width: 52rem) {
  .how-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 4vw, 4rem); }
}

.how-panels { display: grid; gap: clamp(1rem, 2vw, 1.6rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); }
.how-panel { padding: clamp(1.3rem, 2.6vw, 1.9rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.how-panel h3 { font-size: 1.35rem; margin-bottom: .7rem; }
.how-panel p { font-family: var(--font-text); font-size: 1rem; line-height: 1.62; color: var(--ink-2); }
.how-panel p + p { margin-top: .8rem; }

/* ------------------------------------------------------------ catalogue */
/* The releases sit on the dark stage band; each artist is its own group. The band carries its own
   paper and ink, so text resolves against the stage's dark colour scheme rather than the page's. */
.catalogue { background: var(--paper); color: var(--ink); }
.catalogue .cat-group + .cat-group { margin-top: clamp(3.4rem, 8vw, 5.6rem); }
.catalogue .band-head { margin-bottom: clamp(1.4rem, 3vw, 2.2rem); }
.catalogue .band-head h2 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.7rem); }
.catalogue .band-intro { font-size: 1rem; }
.cat-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: clamp(1rem, 2vw, 1.5rem); }
.catalogue .rel { padding: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: border-color var(--t-fast); }
.catalogue .rel:hover { border-color: var(--tint-line); }
.catalogue .rel-cover { border-radius: var(--radius); }
.catalogue .rel-body { display: grid; gap: .2rem; padding: .85rem .45rem .5rem; }
.catalogue .rel-title { margin-top: 0; font-size: 1.36rem; }
.catalogue .rel-stores { gap: .45rem; margin-top: .9rem; }
.catalogue .store { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .45em .95em; font-size: .85rem; }
.catalogue .store-all { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
.catalogue .store-all:hover { background: color-mix(in oklab, var(--fill) 86%, var(--paper)); border-color: transparent; }

.catalogue-note { max-width: var(--measure); }
.catalogue-note h2 { margin-top: 0; }

/* ------------------------------------------------------------ ebook heroes */
/* The page head of an ebook page is its buy page: cover, title, facts and the buy button. */
.eb-head { padding-bottom: clamp(2.4rem, 5vw, 4rem); }
.eb-hero { display: grid; gap: clamp(2.2rem, 5vw, 3rem); align-items: center; }
.eb-cover { justify-self: center; width: min(14rem, 60%); }
.eb-copy { display: grid; gap: 1.05rem; justify-items: start; min-width: 0; }
.eb-copy h1 { max-width: 14ch; }
.eb-copy .page-dek { margin-top: 0; }
.eb-body { max-width: 52ch; font-family: var(--font-text); font-size: var(--fs-prose); line-height: 1.6; color: var(--ink-2); }
.eb-facts { font-size: 1rem; }
.eb-facts strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 720; letter-spacing: -.01em; color: var(--ink); }
.eb-copy .btn-row { margin-top: .2rem; }
.hero-note { max-width: 56ch; font-size: .875rem; line-height: 1.5; color: var(--ink-3); }
@media (min-width: 52rem) {
  .eb-hero { grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: clamp(3rem, 6vw, 6.5rem); }
  .eb-cover { width: 100%; }
}

/* "What's inside": the contents as numbered rows. */
.index-list { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.index-list > li { border-bottom: 1px solid var(--line); }
.index-item {
  display: grid; grid-template-columns: clamp(2.8rem, 6vw, 4rem) minmax(0, 1fr) auto; gap: .6rem clamp(1rem, 2.4vw, 2rem);
  align-items: center; padding: clamp(1.1rem, 2.4vw, 1.5rem) .4rem; color: var(--ink); text-decoration: none;
  transition: background var(--t-fast);
}
.index-item:hover { background: var(--tint); }
.index-num { font-family: var(--font-display); font-weight: 760; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); line-height: 1; letter-spacing: -.03em; color: var(--accent); font-variant-numeric: tabular-nums lining-nums; }
.index-text { display: grid; gap: .3rem; min-width: 0; }
.index-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem); line-height: 1.2; letter-spacing: -.015em; }
.index-dek { font-family: var(--font-text); font-size: 1rem; line-height: 1.5; color: var(--ink-2); }
.index-go { display: inline-flex; align-items: center; gap: .4em; font-size: .875rem; font-weight: 650; color: var(--accent); white-space: nowrap; }
.index-go .ico { width: 1em; height: 1em; transition: transform var(--t-med) var(--spring); }
.index-item:hover .index-go .ico { transform: translateX(4px); }
@media (max-width: 36rem) {
  .index-item { grid-template-columns: 2.6rem minmax(0, 1fr); }
  .index-go { grid-column: 2; justify-self: start; }
}

/* The three angles of the second book. */
.book-angles { margin-top: 0; }
.book-angle { position: relative; padding: 1.6rem 1.4rem 1.6rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.book-angle::before { content: ""; position: absolute; inset: 0 0 auto 0; height: .3rem; background: var(--fill); }
.book-angle h3 { font-size: 1.4rem; margin-bottom: .6rem; }
.book-angle p { font-family: var(--font-text); font-size: 1.02rem; line-height: 1.55; color: var(--ink-2); }
.book-angles-more { margin-top: 1.5rem; font-weight: 650; }
.book-angles-more a { display: inline-flex; align-items: center; gap: .4em; color: var(--accent); }

/* The prose band under the hero: the questions and the sidebar start level with each other. */
.qa-band { padding-block: clamp(2.6rem, 6vw, 4.5rem); }
.qa-band .article-layout { padding-block: 0; }
.qa-band .faq { margin-top: 0; }
.qa-band .faq h2, .qa-band .prose > h2:first-child { margin-top: 0; }
.qa-band .aside-col > .aside-block:first-child { border-top: 0; padding-top: 0; }

/* ------------------------------------------------------------ API docs */
.api-grid { list-style: none; padding: 0; display: grid; gap: clamp(.9rem, 1.8vw, 1.3rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }
.api-card { display: grid; align-content: start; gap: .6rem; min-width: 0; padding: 1.3rem 1.35rem 1.35rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.api-top { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; }
.api-method { display: inline-grid; place-items: center; min-width: 3.2rem; padding: .3em .55em; border-radius: 7px; background: var(--tint); color: var(--accent); font-size: .75rem; font-weight: 750; letter-spacing: .06em; line-height: 1; }
.api-path { font-family: var(--font-mono); font-size: .86rem; color: var(--ink); overflow-wrap: anywhere; text-decoration: none; }
.api-path:hover { color: var(--accent); text-decoration: underline; }
.api-name { font-size: 1.3rem; letter-spacing: -.02em; }
.api-desc { font-family: var(--font-text); font-size: .98rem; line-height: 1.55; color: var(--ink-2); }
.api-desc code { white-space: nowrap; }
.api-example { display: flex; align-items: center; justify-content: space-between; gap: .4rem .75rem; margin-top: .3rem; padding: .4rem .4rem .4rem .8rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.api-example code { flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: none; font-size: .8rem; color: var(--ink-2); overflow-wrap: anywhere; }
.api-example .btn { flex: none; min-height: 2.75rem; }

/* Feeds and machine-readable files: one card per file. */
.mr-grid { list-style: none; padding: 0; display: grid; gap: clamp(.8rem, 1.6vw, 1.1rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.mr-card { display: grid; gap: .3rem; height: 100%; padding: 1.1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color var(--t-fast), transform var(--t-med) var(--ease-out); }
.mr-card:hover { border-color: var(--tint-line); transform: translateY(-2px); }
.mr-path { font-family: var(--font-mono); font-size: .9rem; font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }
.mr-dek { font-size: .95rem; line-height: 1.45; color: var(--ink-2); }

}
