/* =========================================================
   321 Enterprise Labs — hub page styles
   LAB-159 §5a · LAB-209 §3. Split out of labs.css 2026-08-04.

   LOADED BY /labs/index.html ONLY. Not by any tool page.

   Why this file exists: labs.css is additive-only under
   ADR §13 A2 rule 4 — it receives only what every tool needs.
   The hero, the card grid, and the closing band are used by
   exactly one page, and they were about a third of labs.css.
   Leaving them there meant "additive-only" could not actually
   be enforced, because a third of the file already broke it.

   A2 rule 4 sends tool-specific rules to the tool's own
   stylesheet. The hub is not a tool (§5a makes it a
   hand-authored static page — the crawl entry point for the
   suite), so the rule did not literally cover it. The ruling,
   recorded 2026-08-04: the hub is a CONSUMER of the shared
   layer on the same terms as a tool, so its rules live with
   the hub, not in the shared file.

   LOAD ORDER — this file comes AFTER labs.css:

     <link rel="stylesheet" href="/assets/css/style.css">
     <link rel="stylesheet" href="/labs/assets/labs.css">
     <link rel="stylesheet" href="/labs/assets/labs-hub.css">

   It consumes the --labs-* token vocabulary defined in
   labs.css and the status badge defined there too (the badge
   is shared: the hub grid and the injected tool header both
   render it). It defines no tokens of its own.
   ========================================================= */

/* =========================================================
   HUB — hero
   ========================================================= */

.labs-hero {
  position: relative;
  padding-block: clamp(72px, 11vh, 132px) clamp(40px, 6vh, 64px);
  overflow: hidden;
}
.labs-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  width: min(900px, 120vw);
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--brand-blue) 16%, transparent) 0%,
    transparent 68%
  );
  pointer-events: none;
  z-index: 0;
}
.labs-hero > .container { position: relative; z-index: 1; }

.labs-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-blue-light);
  margin-bottom: 22px;
}

.labs-hero-headline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 6.4vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 22px;
  max-width: 16ch;
}
/* Longer headline sentence — the 16ch measure above is tuned for a
   short two-line hook and forces a 54-character line into four lines
   with orphaned words. This widens the measure, steps the size down
   one notch, and lets the browser balance the breaks. */
.labs-hero-headline--long {
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.08;
  max-width: 24ch;
  text-wrap: balance;
}

.labs-hero-headline .labs-accent {
  background: linear-gradient(135deg, var(--brand-blue-light) 0%, var(--brand-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.labs-hero-lede {
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  max-width: 60ch;
}
.labs-hero-lede em {
  font-style: normal;
  color: var(--text-primary);
}

.labs-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 30px;
  font-size: 13px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
.labs-hero-meta strong {
  color: var(--text-secondary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.labs-hero-meta .labs-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--text-tertiary);
  opacity: 0.6;
}


/* =========================================================
   HUB — grid
   ========================================================= */

.labs-grid-section {
  padding-block: 0 clamp(56px, 8vh, 96px);
}

.labs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--labs-grid-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 960px) { .labs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .labs-grid { grid-template-columns: 1fr; } }

.labs-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 24px;
  background: var(--labs-card-bg);
  border: 1px solid var(--labs-card-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  /* Own stacking context, so the z-index:-1 hover glow below paints
     above this card's background rather than escaping to the root and
     disappearing behind it. No layout effect. */
  isolation: isolate;
  transition: transform var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out),
              background-color var(--t-base) var(--ease-out);
}

/* Hover glow — same idiom as .pillar / .specialty on the main site */
.labs-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at 50% 0%,
    color-mix(in srgb, var(--brand-blue) 12%, transparent) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity var(--t-base) var(--ease-out);
  pointer-events: none;
  /* Negative z-index so the glow paints above the card background but
     below the in-flow content. This is what lets the content elements
     below drop their own position/z-index — which is what was breaking
     the stretched link (see .labs-card-hit). */
  z-index: -1;
}

.labs-card--link:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--labs-card-bg-hi);
}
.labs-card--link:hover::before { opacity: 1; }

.labs-card--link:focus-within {
  border-color: var(--brand-blue-light);
}

/* The whole card is clickable via a stretched link, but the
   accessible name stays on the real anchor text.

   BUG FIX 2026-08-01: this anchor lives inside .labs-card-name, so it
   resolves `inset: 0` against its nearest POSITIONED ancestor. While
   .labs-card-name carried `position: relative`, that ancestor was the
   <h2> — the hit area was 331x25 (the title line) instead of the whole
   381x280 card, and clicking the blurb or the call-to-action did
   nothing. The content elements below no longer position themselves;
   the ::before glow sits at z-index -1 instead, which was the only
   reason they needed to. */
.labs-card-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}
.labs-card-hit:focus-visible {
  outline: 2px solid var(--brand-blue-light);
  outline-offset: 2px;
}

.labs-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.labs-card-index {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.labs-card-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0 0 10px;
}

.labs-card-blurb {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

/* Action over destination, always stacked. Side-by-side looked
   fine until a long hostname wrapped and orphaned itself — this
   is stable at every card width and needs no truncation. */
.labs-card-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-top: auto;
  padding-top: 20px;
}

.labs-card-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-blue-light);
  white-space: nowrap;   /* never orphan the arrow onto its own line */
}
.labs-card-action .arrow {
  transition: transform var(--t-fast) var(--ease-out);
}
.labs-card--link:hover .labs-card-action .arrow { transform: translateX(3px); }

/* Host label — only carries its weight when it tells you something
   the card doesn't already say, i.e. that you're leaving this site.
   Internal tools omit it entirely rather than padding the row. */
.labs-card-host {
  font-size: 11.5px;
  color: var(--labs-text-muted);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* ---------- planned cards ----------
   Deliberately not links. Showing the roadmap builds trust;
   clicking into a stub destroys it. The dashed border and the
   PLANNED badge carry that on their own — no footer text, which
   would only restate the badge. */
.labs-card--planned {
  background: transparent;
  border-style: dashed;
  border-color: var(--border-subtle);
  min-height: 0;
}
.labs-card--planned .labs-card-name { color: var(--text-secondary); }
.labs-card--planned .labs-card-blurb { color: var(--labs-text-muted); }


/* =========================================================
   HUB — closing band
   ========================================================= */

.labs-closer {
  padding-block: clamp(56px, 8vh, 88px);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}
.labs-closer-heading {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 14px;
}
.labs-closer-lede {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 auto 28px;
  max-width: 54ch;
}
.labs-closer-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}


/* =========================================================
   MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .labs-card,
  .labs-card::before,
  .labs-card-action .arrow {
    transition: none !important;
  }
  .labs-card--link:hover { transform: none; }
}
