/* /tools: a directory of the web tools this site runs, and the Almanac's own page.
   Loaded by tools.html and tools/almanac.html only. Every colour is micyte.css's own
   (:root): ochre is place and structure, violet is the network, moss is a verdict.
   Shape follows the kind of thing shown: the featured tool is a panel, a tool is a
   listing, an application to try is a tile, a file is a table row. */

.tdir { box-sizing: border-box; max-width: 84rem; padding-inline: var(--gut); }
.tdir *, .tdir *::before, .tdir *::after { box-sizing: border-box; }
.tdir { padding-block: clamp(2rem, 6vh, 3.5rem) clamp(3rem, 9vh, 5.5rem); }

/* the head: what this is, and a way to narrow it */
.tdir-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.25rem 3rem; margin-bottom: clamp(1.5rem, 4vh, 2.25rem); }
.tdir-head h1, .almpage-head h1 { margin: 0; font: 500 clamp(2.2rem, 1.5rem + 2.8vw, 3.5rem)/1.02 var(--display); letter-spacing: -0.03em; }
.tdir-head .lede, .almpage-head .lede { margin: 0.8rem 0 0; max-width: 46ch; color: #d6cfc2; font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.15rem); line-height: 1.5; }
.tdir-find { flex: 0 1 21rem; display: grid; gap: 0.4rem; margin: 0; }
.tdir-find[hidden] { display: none; }
.tdir-find label { font: 500 0.82rem/1 var(--sans); color: var(--hyphae-dim); }
.tdir-find input { width: 100%; min-height: 2.75rem; padding: 0.65rem 0.9rem; font: 1rem/1.2 var(--sans); color: var(--hyphae); background: var(--well); border: 1px solid var(--rule); border-radius: 10px; }
.tdir-find input:focus { outline: 2px solid var(--ochre); outline-offset: 1px; border-color: var(--ochre); }

/* the icons: one drawing hand for every tool */
.tdir-icon { flex: none; display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 12px; background: var(--well); border: 1px solid var(--rule); color: var(--hyphae); }
.tdir-icon svg { width: 2.15rem; height: 2.15rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tdir-icon .o { fill: var(--well); }
.tdir-icon .a { stroke: none; }
.tdir-icon--place .a { fill: var(--ochre); }
.tdir-icon--net .a { fill: var(--violet); }
.tdir-icon--lg { width: 4.25rem; height: 4.25rem; border-radius: 15px; }
.tdir-icon--lg svg { width: 2.8rem; height: 2.8rem; }

/* the featured tool */
.tdir-feature { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(1.75rem, 5vw, 4.5rem); padding: clamp(1.4rem, 3vw, 2.6rem); background: var(--raised); border: 1px solid var(--rule); border-radius: var(--radius); }
.tdir-feature__name { margin: 1.1rem 0 0; font: 500 clamp(1.9rem, 1.4rem + 1.8vw, 2.7rem)/1.04 var(--display); letter-spacing: -0.025em; }
.tdir-feature__what { margin: 0.55rem 0 0; max-width: 28ch; font-size: clamp(1.12rem, 1rem + 0.55vw, 1.35rem); line-height: 1.38; }
.tdir-feature__more { margin: 1rem 0 0; max-width: 46ch; color: #d6cfc2; }
.tdir-feature__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.4rem; margin: 1.6rem 0 0; }
.tdir-reads { font: 0.85rem/1.3 var(--sans); color: var(--hyphae-dim); }
.tdir-reads a, .tdir-file { font-family: var(--mono); font-size: 0.84rem; color: var(--hyphae); overflow-wrap: anywhere; }

/* the ten stages, drawn as the site's strand: a hypha with a node per stage, in order */
.tdir-stages { margin: 0; align-self: center; }
.tdir-stages ol { list-style: none; margin: 0; padding: 0; }
.tdir-stages li { position: relative; display: flex; align-items: center; gap: 0.9rem; padding: 0.27rem 0; font: 0.95rem/1.25 var(--sans); }
.tdir-stages li::before { content: ""; position: absolute; left: calc(0.65rem - 0.5px); top: 0; bottom: 0; width: 1px; background: var(--ochre); opacity: 0.55; }
.tdir-stages li:first-child::before { top: 50%; }
.tdir-stages li:last-child::before { bottom: 50%; }
.tdir-stages__n { position: relative; flex: none; display: grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 1px solid var(--ochre); background: var(--well); font: 600 0.66rem/1 var(--sans); font-variant-numeric: tabular-nums; }
.tdir-stages li.tdir-stages__gap { padding: 0.7rem 0 0.7rem 2.2rem; font: italic 0.88rem/1.2 var(--serif); color: var(--hyphae-dim); }
.tdir-stages li.tdir-stages__gap::before { background: none; border-left: 1px dashed var(--ochre); opacity: 0.7; }
.tdir-stages figcaption { margin: 1.1rem 0 0; max-width: 36ch; font: 0.88rem/1.5 var(--sans); color: var(--hyphae-dim); }

/* shelves of listings */
.tdir-shelf { margin-top: clamp(2.75rem, 7vh, 4rem); }
.tdir-shelf__name { margin: 0; font: 500 clamp(1.3rem, 1.1rem + 0.8vw, 1.65rem)/1.2 var(--display); letter-spacing: -0.015em; }
.tdir-shelf__note { margin: 0.35rem 0 0; max-width: 62ch; font: 0.94rem/1.5 var(--sans); color: var(--hyphae-dim); }
.tdir-shelf__note a { color: var(--hyphae); }
.tdir-list { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 25rem), 1fr)); gap: 0.9rem; }
.tdir-item { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 1.05rem; align-items: start; padding: 1.15rem 1.2rem; background: var(--raised); border: 1px solid var(--rule); border-radius: var(--radius); }
.tdir-item:hover { border-color: #4b4032; }
.tdir-item__name, .tdir-app__name { margin: 0.15rem 0 0; font: 500 1.14rem/1.25 var(--display); letter-spacing: -0.01em; }
.tdir-item__name a, .tdir-app__name a { color: var(--hyphae); text-decoration: none; }
.tdir-item__name a::after, .tdir-app__name a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.tdir-item__name a:focus-visible, .tdir-app__name a:focus-visible { outline: none; }
.tdir-item__name a:focus-visible::after, .tdir-app__name a:focus-visible::after { outline: 2px solid var(--ochre); outline-offset: 2px; }
.tdir-item__what { margin: 0.3rem 0 0; font-size: 0.98rem; line-height: 1.45; color: #d6cfc2; }
.tdir-item__reads { margin: 0.65rem 0 0; font: 0.8rem/1.35 var(--sans); color: var(--hyphae-dim); }
.tdir-item__reads a { position: relative; z-index: 1; }
.tdir-open { align-self: center; font: 600 0.78rem/1 var(--sans); letter-spacing: 0.02em; color: var(--hyphae); border: 1px solid var(--rule); border-radius: 999px; padding: 0.55rem 0.95rem; }
.tdir-item:hover .tdir-open, .tdir-app:hover .tdir-app__open { border-color: var(--ochre); }

/* applications to try: tiles, lighter than listings */
.tdir-apps { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); gap: 0.9rem; }
.tdir-app { position: relative; display: flex; flex-direction: column; padding: 1.05rem; border: 1px solid var(--rule); border-radius: var(--radius); }
.tdir-app:hover { border-color: #4b4032; }
.tdir-app__name { margin-top: 0.85rem; }
.tdir-app__what { flex: 1; margin: 0.3rem 0 0.9rem; font: 0.88rem/1.45 var(--sans); color: var(--hyphae-dim); }
.tdir-app__open { align-self: flex-start; font: 600 0.74rem/1 var(--sans); color: var(--hyphae); border: 1px solid var(--rule); border-radius: 999px; padding: 0.45rem 0.8rem; }

/* the files themselves */
.tdir-data { width: 100%; margin-top: 1.1rem; border-collapse: collapse; font: 0.92rem/1.45 var(--sans); }
.tdir-data th { padding: 0 1.25rem 0.55rem 0; text-align: left; font: 500 0.8rem/1.2 var(--sans); color: var(--hyphae-dim); border-bottom: 1px solid var(--rule); }
.tdir-data td { padding: 0.8rem 1.25rem 0.8rem 0; vertical-align: top; border-bottom: 1px solid var(--rule); color: #d6cfc2; }
.tdir-data td:first-child { white-space: nowrap; }
.tdir-licence { margin: 1rem 0 0; max-width: 64ch; font: 0.9rem/1.5 var(--sans); color: var(--hyphae-dim); }
.tdir-licence a, .tdir-more a { color: var(--hyphae); }
.tdir-more { margin: clamp(2.75rem, 7vh, 4rem) 0 0; padding-top: 1.25rem; border-top: 1px solid var(--rule); max-width: 64ch; color: #d6cfc2; }

.tdir-none { margin: 2rem 0 0; font: 1rem/1.5 var(--sans); color: #d6cfc2; }
.tdir-none button { font: 600 0.85rem/1 var(--sans); color: var(--hyphae); background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: 0.5rem 0.9rem; margin-left: 0.5rem; cursor: pointer; }
.tdir [hidden] { display: none !important; }

@media (max-width: 52rem) {
  .tdir-feature { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .tdir-item { grid-template-columns: auto minmax(0, 1fr); }
  .tdir-open { display: none; }
  /* a phone has room for one tile a row, so a tile becomes a row: icon beside its words */
  .tdir-apps { gap: 0.6rem; }
  .tdir-app { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.05rem; padding: 0.95rem 1.05rem; }
  .tdir-app .tdir-icon { grid-row: span 2; }
  .tdir-app__name { margin-top: 0.1rem; }
  .tdir-app__what { margin: 0.3rem 0 0; }
  .tdir-app__open { display: none; }
  .tdir-data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tdir-data, .tdir-data tbody, .tdir-data tr, .tdir-data td { display: block; }
  .tdir-data tr { padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
  .tdir-data td { padding: 0.1rem 0; border: 0; white-space: normal; }
  .tdir-data td:first-child { white-space: normal; }
}

/* one moment of motion: the strand grows down its ten stages, once */
@media (prefers-reduced-motion: no-preference) {
  .tdir-stages li { animation: tdir-grow 380ms ease-out both; animation-delay: calc(var(--i, 0) * 60ms + 150ms); }
  @keyframes tdir-grow { from { opacity: 0; transform: translateY(-5px); } }
}

/* the Almanac's page: wide, because the calendar is a chart */
/* no gutter of its own: the panel carries the site's (#almanac in micyte.css) */
.almpage { box-sizing: border-box; max-width: 84rem; padding-block: 0 clamp(2.5rem, 7vh, 4.5rem); }
.almpage-head { padding: clamp(2rem, 6vh, 3.5rem) var(--gut) 0; }
.almpage .alm { --alm-page: var(--substrate); }
.almpage-about { box-sizing: border-box; max-width: 84rem; padding: clamp(2.5rem, 7vh, 4rem) var(--gut); border-top: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 62ch); gap: clamp(1.25rem, 5vw, 4.5rem); }
.almpage-about h2 { margin: 0; font: 500 clamp(1.35rem, 1.15rem + 0.8vw, 1.7rem)/1.2 var(--display); letter-spacing: -0.015em; }
.almpage-about p { margin: 0 0 1rem; color: #d6cfc2; }
.almpage-about p:last-child { margin-bottom: 0; }
@media (max-width: 52rem) { .almpage-about { grid-template-columns: minmax(0, 1fr); } }
