/* The feature directory (pages/features.html; docs/mocks/site/features.html), after outer/bands.css: the night it opens
   on, then the home page's story in four chapters, each a band in its part's color. A chapter's best features are tiles
   on real screens of today's app, bleeding off the tile's edge; the rest are compact links. */
.features-index .directory-chapter { padding-block: clamp(80px, 10vw, 136px); scroll-margin-top: 72px; }
.features-index .night-hero + .directory-chapter { padding-top: clamp(56px, 7vw, 96px); }

/* a chapter's head: its kicker, then the title and its one line side by side */
.directory-chapter__head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); column-gap: clamp(24px, 5vw, 72px); row-gap: var(--space-4); align-items: end; margin-bottom: clamp(32px, 4vw, 52px); }
.directory-chapter__head .kicker { grid-column: 1 / -1; color: var(--m); }
.directory-chapter__head h2 { font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: clamp(38px, 4.4vw, 62px); line-height: 1.03; letter-spacing: -.035em; color: var(--ink); text-wrap: balance; }
.directory-chapter__head .lead { max-width: 34em; font-size: var(--fs-md); line-height: 1.65; color: var(--text); }
.directory-chapter[data-tone="dark"] .directory-chapter__head h2 { color: var(--band-on-dark); }
.directory-chapter[data-tone="dark"] .directory-chapter__head .lead { color: var(--band-on-dark-soft); }

/* ---------- the tiles: twelve columns, each tile a link with its words above a real screen ---------- */
.directory-tiles { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
.directory-tile--5 { grid-column: span 5; }
.directory-tile--7 { grid-column: span 7; }
.directory-tile--12 { grid-column: 1 / -1; }
.directory-tile > a { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: var(--r-2xl); background: var(--bg-panel); color: inherit; text-decoration: none;
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -44px rgba(var(--shadow-rgb), .45); transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.directory-tile > a:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px color-mix(in srgb, var(--m) 35%, var(--line)), 0 40px 70px -40px rgba(var(--shadow-rgb), .5); }
.directory-tile > a:focus-visible { outline: 2px solid var(--m); outline-offset: 3px; }
.directory-tile__copy { flex: 1; display: grid; align-content: start; justify-items: start; gap: var(--space-2); padding: var(--space-7) var(--space-8) var(--space-6); }
.directory-tile h3 { font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: clamp(24px, 2.1vw, 30px); line-height: 1.1; letter-spacing: -.02em; color: var(--ink); }
.directory-tile__line { max-width: 46ch; font-size: var(--fs-sm); line-height: 1.6; color: var(--text); }
.directory-tile__more { display: inline-flex; align-items: center; gap: var(--icon-gap-sm); margin-top: var(--space-1); font-size: var(--fs-sm); font-weight: 600; color: var(--m); }
.directory-tile__more .bg-icon { transition: translate .2s var(--ease-out); }
.directory-tile > a:hover .directory-tile__more .bg-icon { translate: 3px 0; }
/* the screen near the app's own size (about 0.9x of its 1280 CSS pixels), on a wash of the part's color, from the
   tile's left edge off its right and bottom ones */
.directory-tile__shot { flex: none; display: flex; align-items: flex-start; height: clamp(260px, 26vw, 360px); padding: var(--space-6) 0 0 var(--space-8); overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--m) 5%, var(--bg-panel)), color-mix(in srgb, var(--m) 14%, var(--bg-panel))); }
.directory-tile__shot > :is(img, .screen-focus) { flex: none; width: 760px; border-radius: var(--r-lg) 0 0 0; background: var(--bg-panel);
  box-shadow: 0 0 0 1px rgba(var(--shadow-rgb), .08), 0 24px 50px -24px rgba(var(--shadow-rgb), .45); }
.directory-tile__shot > img { display: block; height: auto; }
/* a strip: a wide screen across the whole tile, cut at its foot */
.directory-tile--strip .directory-tile__shot { height: auto; padding-inline: var(--space-8); }
.directory-tile--strip .directory-tile__shot > .screen-focus { width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; }
/* a document: its paper whole across the tile, cut at its foot (a paper cut at the side leaves its right column in pieces) */
.directory-tile--doc .directory-tile__shot { padding-inline: var(--space-8); }
.directory-tile--doc .directory-tile__shot > .screen-focus { width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; }
/* the client's phone, rising from the foot of its tile */
.directory-tile__shot:has(> .directory-tile__phone) { justify-content: center; padding-left: 0; }
.directory-tile__phone { flex: none; width: 236px; overflow: hidden; border: 6px solid var(--sand-900); border-bottom: 0; border-radius: 34px 34px 0 0; background: var(--bg-panel); box-shadow: 0 24px 50px -24px rgba(var(--shadow-rgb), .5); }
.directory-tile__phone img { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) { .directory-tile > a, .directory-tile__more .bg-icon { transition: none; } .directory-tile > a:hover { transform: none; } }

/* the rest of a chapter: compact links under its tiles, four of them two by two */
.detail-grid--links { margin-top: var(--space-4); }
@media (min-width: 641px) { .detail-grid--links:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.directory-note { margin-top: var(--space-5); font-size: var(--fs-sm); color: var(--caption); }
.directory-note a { color: var(--ink); text-underline-offset: 3px; }
.directory-end { display: flex; justify-content: space-between; gap: var(--space-6); padding-block: var(--space-8) var(--space-6); color: var(--text-muted); font-size: var(--fs-sm); }
.directory-end a { color: var(--ink); text-underline-offset: 4px; }
@media (max-width: 900px) {
  .directory-chapter__head { grid-template-columns: minmax(0, 1fr); }
  .directory-tile--5, .directory-tile--7 { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .directory-tile__copy { padding: var(--space-6) var(--space-6) var(--space-5); }
  .directory-tile__shot { height: 240px; padding-left: var(--space-6); }
  .directory-tile__shot > :is(img, .screen-focus) { width: 560px; }
  :is(.directory-tile--strip, .directory-tile--doc) .directory-tile__shot { padding-inline: var(--space-6); }
  .directory-tile--doc .directory-tile__shot { height: auto; }   /* one tile a row: the paper sets its own height */
  .directory-tile--strip .directory-tile__shot > .screen-focus { width: 260%; border-radius: var(--r-lg) 0 0 0; }
  .directory-end { flex-direction: column; gap: var(--space-2); }
}
