/* Hallmark · page: home · shape: custom, a desktop (concept J) · genre: modern-minimal · theme: Ink · system in hub/base.css
 * hero: the first screen as a desktop, the headline near the top, the dock under it, one app's details always open under the dock · signature: a dock of the production app icons that magnify under the pointer */
/* Hallmark · waive 6b · the headline, the dock and the details are centred on the first screen · a desktop with a dock is centred by nature, and the notes and hello below it are left-aligned */

/* Home: the first screen is a desktop. The headline near the top on a faint dot field; the apps in a dock under it,
   with All apps (the Tools page) at its end; one app's details are always open under the dock, the first until
   another icon is pointed at or focused (home-dock.js), and a dot under an icon says whose they are; then the stack,
   the latest notes and a way to say hello. Once there are more apps than fit, home-dock.js turns the dock into a slow marquee. */
.desk {
  display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center;
  padding-block: var(--space-lg) var(--space-sm);
  background-image: radial-gradient(color-mix(in oklab, var(--color-ink) 9%, transparent) 1px, transparent 1px);
  background-size: 22px 22px; background-position: center;
}
.desk-hero { display: grid; justify-items: center; gap: var(--space-sm); text-align: center; }
.desk-mark .mark { width: 48px; height: auto; }
.desk-hero h1 { font-size: clamp(1.875rem, 2.4vw + 0.75rem, 2.75rem); line-height: 1.02; max-width: 20ch; }
.desk-hero .lede { font-size: var(--text-md); color: var(--color-muted); }
.desk-hero .actions { justify-content: center; margin-top: var(--space-xs); }

/* The dock: a quiet bar, the apps in a viewport that can scroll, then a hairline and All apps */
.dock {
  display: flex; align-items: flex-end; gap: var(--space-sm); max-width: 100%; margin-top: var(--space-xl);
  padding: var(--space-xs) var(--space-sm); background: var(--color-paper-2); border: var(--rule-hair) solid var(--color-rule);
  border-radius: 20px; box-shadow: 0 12px 32px color-mix(in oklab, var(--color-ink) 10%, transparent);
}
.dj-viewport { flex: 0 1 auto; min-width: 0; overflow-x: clip; overflow-y: visible; }
.dj-row { list-style: none; margin: 0; padding: var(--space-sm) 0 0; display: flex; align-items: flex-end; gap: var(--space-2xs); width: max-content; }
.dj-app, .dj-all { display: grid; justify-items: center; gap: var(--space-2xs); min-width: 76px; padding-inline: var(--space-2xs); border-radius: 14px; }
.dj-all { flex: none; padding-left: var(--space-sm); border-left: var(--rule-hair) solid var(--color-rule); border-radius: 0; }
.dj-icon { display: grid; place-items: center; width: 52px; height: 52px; transform-origin: 50% 100%; transition: transform var(--dur-short) var(--ease-out); }
.dj-name { max-width: 100%; font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--dur-micro) var(--ease-out); }
.dj-item:hover .dj-name, .dj-item:focus-within .dj-name, .dj-all:hover .dj-name, .dj-item.is-on .dj-name { color: var(--color-ink); }
/* A dot under the app whose details are open, like a running app in a dock. Every tile keeps the dot's space. */
.dj-app::after, .dj-all::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: transparent; transition: background-color var(--dur-short) var(--ease-out); }
.dj-item.is-on .dj-app::after { background: var(--color-ink); }
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .dj-item:hover .dj-icon, .dj-item:focus-within .dj-icon, .dj-all:hover .dj-icon { transform: translateY(-8px) scale(1.22); }
  .dj-item:has(+ .dj-item:hover) .dj-icon, .dj-item:hover + .dj-item .dj-icon { transform: translateY(-4px) scale(1.1); }
}
.dj-app:active .dj-icon, .dj-all:active .dj-icon { transform: translateY(-6px) scale(1.15); }

/* The marquee, only once the apps overflow (dock.js clones the row and adds .run) */
@media (prefers-reduced-motion: no-preference) {
  .dj-row.run { animation: dj-scroll var(--dj-ms, 40s) linear infinite; }
  .dock:hover .dj-row.run, .dock:focus-within .dj-row.run { animation-play-state: paused; }
  @keyframes dj-scroll { to { transform: translateX(-50%); } }
}
@media (prefers-reduced-motion: reduce) { .dj-viewport { overflow-x: auto; } }

/* The details: one app's are always open under the dock, and pointing at or focusing another app swaps them. They
   share one grid cell, so the page below never moves. Without home-dock.js they all show, one under another. */
.dock-wrap { position: relative; display: grid; justify-items: center; width: 100%; }
.dj-dets { display: grid; gap: var(--space-sm); width: min(760px, 100%); margin-top: var(--space-lg); }
.dj-det {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: var(--space-xl); align-items: center; width: 100%;
  padding: var(--space-md) var(--space-lg); text-align: left; background: var(--color-paper); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card);
}
.dj-det-text { display: grid; gap: var(--space-xs); justify-items: start; }
.dj-det-text h2 { font-size: var(--text-xl); letter-spacing: -0.03em; }
.dj-links { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); }
.dj-links a { font-size: var(--text-sm); }
.dj-det-text p { color: var(--color-ink-2); }
/* One card swaps for the next with a quick cross-fade, a little blur and a slight rise */
.js .dj-det {
  grid-area: 1 / 1; opacity: 0; visibility: hidden; filter: blur(6px); transform: translateY(6px) scale(0.985);
  transition: opacity var(--dur-short) var(--ease-out), filter var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out), visibility var(--dur-short);
}
.js .dj-det.on { opacity: 1; visibility: visible; filter: none; transform: none; transition-delay: 0s; }

/* The foot of the desktop: the stack as one still row with a slow wave of light, then notes and a way to say hello */
.desk-foot { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); width: 100%; margin-top: var(--space-2xl); }
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); }
.strip-label, .desk-links h2 { flex: none; font-size: var(--text-xs); font-weight: 500; letter-spacing: 0; color: var(--color-muted); }
.strip .stack { flex: 1; justify-content: space-between; gap: var(--space-sm) var(--space-lg); }
.strip .stack-item { white-space: nowrap; }
/* A continuous rising wave: every logo in full colour, each lifting a little just after the one before it */
@media (prefers-reduced-motion: no-preference) {
  .strip .stack-item { animation: rise 4s var(--ease-in-out) infinite; animation-delay: calc(var(--n) * 0.3s); }
  @keyframes rise { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
}
.strip .stack-item:nth-child(1) { --n: 0; } .strip .stack-item:nth-child(2) { --n: 1; } .strip .stack-item:nth-child(3) { --n: 2; }
.strip .stack-item:nth-child(4) { --n: 3; } .strip .stack-item:nth-child(5) { --n: 4; } .strip .stack-item:nth-child(6) { --n: 5; }
.strip .stack-item:nth-child(7) { --n: 6; } .strip .stack-item:nth-child(8) { --n: 7; } .strip .stack-item:nth-child(9) { --n: 8; }
.desk-links { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gap-columns); text-align: left; }
.desk-notes, .desk-hello { display: grid; gap: var(--space-xs); align-content: start; justify-items: start; padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-ink); }
.desk-links h2 { font-size: var(--text-sm); }
.desk-notes a:not(.more) { font-size: var(--text-md); font-weight: 500; letter-spacing: -0.01em; line-height: 1.4; transition: color var(--dur-micro) var(--ease-out); }
.desk-notes a:not(.more):hover { color: var(--color-accent); }
.desk-hello p { font-size: var(--text-md); color: var(--color-ink-2); }
.desk-hello .mail { font-size: var(--text-md); font-weight: 500; letter-spacing: -0.01em; text-decoration: underline var(--rule-hair) var(--color-rule-2); text-underline-offset: 0.3em; }
.desk-hello .mail:hover { text-decoration-color: var(--color-accent); }
.desk-links .more { font-size: var(--text-sm); font-weight: 600; text-decoration: underline var(--rule-hair) var(--color-rule-2); text-underline-offset: 0.3em; }
.desk-links .more:hover { text-decoration-color: var(--color-accent); }

/* Narrow windows and touch: the dock wraps into a grid; a tap shows an app's details, a tap on the open one opens the app */
@media (max-width: 40rem) {
  .desk { min-height: 0; }
  .desk-links { grid-template-columns: minmax(0, 1fr); }
  .dock { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: var(--space-md) var(--space-xs); width: 100%; padding: var(--space-md) var(--space-sm); border-radius: var(--radius-card); }
  .dj-viewport, .dj-row { display: contents; }
  .dj-app, .dj-all { min-width: 0; }
  .dj-name { white-space: normal; text-align: center; line-height: 1.25; }
  .strip { flex-direction: column; align-items: flex-start; }
  .strip .stack { width: 100%; justify-content: flex-start; gap: var(--space-sm) var(--space-md); }
  .dj-all { border-left: 0; padding-left: 0; }
  .dj-det { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
}

/* Small previews: one per app, the app's own screen in miniature */
.pv { display: grid; gap: var(--space-xs); font-size: var(--text-xs); }
.pv-box { padding: var(--space-xs) var(--space-sm); background: var(--color-paper); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill); }
.pv-q { display: flex; justify-content: space-between; gap: var(--space-xs); font-family: var(--font-outlier); }
.pv-q small { font-family: var(--font-body); color: var(--color-muted); }
.pv-hit { display: grid; gap: var(--space-3xs); }
.pv-hit code { font-weight: 500; }
.pv-hit span { color: var(--color-ink-2); }
.pv-log { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3xs); }
.pv-log li { display: grid; grid-template-columns: 7ch 12px minmax(0, 1fr); gap: var(--space-xs); padding: var(--space-3xs) var(--space-xs); border-radius: 6px; align-items: baseline; }
.pv-log code { color: var(--color-muted); }
.pv-log i { font-style: normal; font-weight: 600; text-align: center; }
.pv-log span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-log .run i { color: var(--color-status-run); }
.pv-log .ok i { color: var(--color-status-ok); }
.pv-log .bad { background: var(--color-status-bad-soft); }
.pv-log .bad i, .pv-log .bad span { color: var(--color-status-bad); }
.pv-sync { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); align-items: center; }
.pv-sync .wire { border-top: var(--rule-hair) dashed var(--color-rule-2); }
.pv-sync b { display: block; font-weight: 600; }
.pv-sync small { color: var(--color-muted); }
.pv-sync .ok { color: var(--color-status-ok); font-weight: 600; }
.pv-mod { display: flex; justify-content: space-between; align-items: center; gap: var(--space-xs); }
.pv-mod + .pv-mod { padding-top: var(--space-2xs); border-top: var(--rule-hair) solid var(--color-rule); }
.pv-mod span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-mod i { position: relative; width: 22px; height: 12px; flex: none; border-radius: 6px; background: var(--color-paper-3); box-shadow: inset 0 0 0 1px var(--color-rule-2); }
.pv-mod i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-muted); }
.pv-mod i.on { background: var(--color-accent); box-shadow: none; }
.pv-mod i.on::after { left: 12px; background: var(--color-paper); }


/* The stack: each logo in its brand colour beside its name */
.stack { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-md); }
.stack-item { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: var(--text-sm); color: var(--color-ink-2); }
.stack-item svg { width: 18px; height: 18px; color: var(--color-ink); }
[data-tech="python"] svg { color: var(--brand-python); } [data-tech="fastapi"] svg { color: var(--brand-fastapi); }
[data-tech="postgresql"] svg { color: var(--brand-postgresql); } [data-tech="snowflake"] svg { color: var(--brand-snowflake); }
[data-tech="dbt"] svg { color: var(--brand-dbt); } [data-tech="docker"] svg { color: var(--brand-docker); } [data-tech="caddy"] svg { color: var(--brand-caddy); }
[data-tech="django"] svg { color: var(--brand-django); } [data-tech="sql"] svg { color: var(--brand-sql); }

/* All apps: a plain tile in the same size as the app icons */
.all-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 22%; background: var(--color-paper-3); box-shadow: inset 0 0 0 1px var(--color-rule); color: var(--color-ink); }
.all-icon svg { width: 58%; height: 58%; }
.dj-icon .app-logo { flex: none; }

/* The brand mark keeps its own animation (brand-mark.js); the desktop field stays behind everything */
.desk { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
