/* hub.css — styles unique to the home page. Everything shared lives in
 * /shared/ds.css. Selectors here are .hub-* prefixed per the apps/<id>/ contract.
 *
 * NOTE: hub files are deliberately FLAT (index.html, hub.css, hub.js — no js/,
 * css/ or assets/ directories). The hub is copied to the web root, so a js/ or
 * css/ directory here would collide with the legacy /js and /css aliases that
 * server/src/index.js keeps pointing at the CM360 tool.
 */

/* A little wider than a tool page: the copy needs room beside the particle scene. The
   screens set their own vertical rhythm, so main adds none. */
#hub-root { max-width: 1240px; padding-top: 0; padding-bottom: 0; }

/* The footer sits at the bottom of the window even when the page is short (the denied
   gate), so the page is a column and main takes the slack. */
body.hub-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.hub-page #hub-root { flex: 1 0 auto; width: 100%; }
.hub-foot {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-2) var(--sp-6);
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding: var(--sp-6) var(--gutter) var(--sp-8);
  font-size: var(--fs-sm); color: var(--ink-3);
}
/* The rule spans the content column, not the gutters, so it lines up with the rows above. */
.hub-foot::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid var(--line); }
.hub-foot a { color: var(--ink-2); }
/* The footer carries the privacy link here, so the denied gate's own copy would repeat it.
   Tools' gates keep theirs (they have no footer). */
body.hub-page .pf-gate-legal { display: none; }

/* ---- the story: one screen per section, the particle field fixed behind them all ----
   (hub.js place() moves the field with the scroll.) No boxes: type on the canvas. */
.hub-sec {
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 100vh; min-height: 100svh;
  padding: var(--sp-16) 0;
}
.hub-hero { min-height: calc(100vh - var(--top-h)); min-height: calc(100svh - var(--top-h)); padding-bottom: var(--sp-16); }
.hub-copy { display: flex; flex-direction: column; align-items: flex-start; width: min(540px, 100%); }
.hub-hero .hub-copy { width: min(620px, 100%); }
/* The shape holds one side of the screen; the copy takes the other. */
.hub-sec[data-side="left"] .hub-copy { margin-left: auto; }
.hub-sec[data-side="right"] .hub-copy { margin-right: auto; }

.hub-sec h1 {
  margin: var(--sp-5) 0 0;
  font: 400 clamp(56px, 8.4vw, 116px)/.92 var(--font-display);
  letter-spacing: -.045em;
  text-wrap: balance;
}
.hub-sec h2 {
  margin: var(--sp-5) 0 0;
  font: 400 clamp(40px, 5.4vw, 78px)/1 var(--font-display);
  letter-spacing: -.04em;
  text-wrap: balance;
}
.hub-sec p { margin: var(--sp-6) 0 0; max-width: 34em; color: var(--ink-2); font-size: var(--fs-lg); line-height: 1.55; text-wrap: pretty; }
.hub-sec p + p { margin-top: var(--sp-3); }
.hub-sec .pf-lede { max-width: 31em; margin-bottom: 0; }

/* The one action of a screen. */
.hub-sec .hub-cta.pf-btn { --h: 48px; margin-top: var(--sp-10); padding: 0 26px; font-size: 15px; }
.hub-sec .hub-cta.pf-primary::after { content: "→"; transition: transform 220ms var(--ease); }
.hub-sec .hub-cta.pf-primary:hover::after { transform: translateX(4px); }
.hub-locked-note { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-3); }

/* The list: one row per tool in large type, a hairline between rows and the cyan line that
   sweeps across on hover. A row opens its tool. */
.hub-list .hub-copy { width: 100%; }
.hub-rows { list-style: none; width: 100%; margin: var(--sp-10) 0 0; padding: 0; border-top: 1px solid var(--line-strong); }
.hub-row {
  position: relative;
  display: grid; grid-template-columns: 56px minmax(0, 1.05fr) minmax(0, 1fr) auto;
  align-items: baseline; gap: var(--sp-6);
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink); text-decoration: none;
}
.hub-row::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0;
  background: var(--accent); transition: width 420ms var(--ease);
}
a.hub-row:hover { text-decoration: none; }
a.hub-row:hover::after, a.hub-row:focus-visible::after { width: 100%; }
.hub-row-n { font: 400 var(--fs-sm)/1 var(--font-mono); color: var(--ink-3); }
.hub-row-t { font: 400 clamp(26px, 3vw, 42px)/1.05 var(--font-display); letter-spacing: -.03em; }
.hub-row-d { color: var(--ink-2); font-size: var(--fs-md); line-height: 1.5; }
.hub-row-go { font-size: 20px; color: var(--ink-3); transition: transform 220ms var(--ease), color var(--dur) var(--ease); }
a.hub-row:hover .hub-row-go, a.hub-row:focus-visible .hub-row-go { transform: translateX(6px); color: var(--ink); }
/* A tool that needs one more Google permission: a dashed rule and a button, not a link. */
.hub-row-locked { border-bottom-style: dashed; }
.hub-row-locked .hub-row-t, .hub-row-locked .hub-row-d { color: var(--ink-3); }
.hub-grant { align-self: center; }

/* The last screen: the wordmark above, the closing lines centred beneath it. */
.hub-end { justify-content: flex-end; padding-bottom: 14vh; text-align: center; }
.hub-end .hub-copy { align-items: center; margin: 0 auto; }

/* Each screen's copy rises in, line after line, as the screen arrives (hub.js reveal()). */
.hub-in {
  opacity: .001; transform: translateY(24px);
  transition: opacity 700ms var(--ease), transform 900ms var(--vt-in);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.hub-on .hub-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .hub-in { transform: none; transition-delay: 0ms; } }

/* A phone: the shape holds the top of each screen and the copy sits below it. The list
   has no shape of its own (the field is all around), so it starts at the top. */
@media (max-width: 899px) {
  .hub-sec { justify-content: flex-end; padding: 44vh 0 var(--sp-12); padding-top: 44svh; }
  .hub-hero { padding-bottom: var(--sp-10); }
  .hub-list { justify-content: flex-start; padding-top: var(--sp-16); }
  .hub-sec[data-side] .hub-copy { margin: 0; }
  .hub-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: var(--sp-2) var(--sp-3); padding: var(--sp-4) 0; }
  .hub-row-d { grid-column: 2; grid-row: 2; font-size: var(--fs-sm); }
  .hub-row-go, .hub-grant { grid-column: 3; grid-row: 1; }
  .hub-end { padding-bottom: var(--sp-16); }
}
