/*
 * /tools/ hub.
 *
 * Every text element inside the link cards is a <span>, so each one is
 * explicitly set to display:block: inline spans would run the eyebrow, title
 * and body together on one line at three different sizes.
 */

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hub-hero {
  display: grid; gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center; margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
@media (min-width: 900px) {
  .hub-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
}
.hub-hero-copy { min-width: 0; }

.hub-hero-proof {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.5rem 1.35rem;
  margin-top: 1.5rem; padding-top: 1.15rem;
  border-top: 1px solid var(--bpt-border);
  font-size: 0.86rem; color: var(--bpt-subtle); font-weight: 600;
}
.hub-hero-proof strong { color: var(--bpt-ink); font-weight: 800; }

/* Two overlapping device shots: depth without a stock photo.
   The source images are full-length phone screenshots, so each frame fixes a
   phone aspect ratio and crops to the top of the screen. Without that the tall
   images size themselves off their own height and spill over the page. */
.hub-hero-media { position: relative; height: 24rem; display: none; }
@media (min-width: 900px) { .hub-hero-media { display: block; } }

/* Below 900px the device shots are hidden and the grid drops to one column, but the
   shared heading and standfirst keep the reading measures they were given for a
   two-column hero (20ch / 60ch). The result was a hero with nothing on the right and
   copy that refused to grow into it. When the artwork is gone the copy takes the width
   back; above 900px nothing here applies and the two-column composition is untouched. */
@media (max-width: 899px) {
  .hub-hero-copy .bpt-h1 { max-width: 26ch; }
  .hub-hero-copy .bpt-standfirst { max-width: none; }
}
.hub-device {
  position: absolute;
  width: 10.5rem; aspect-ratio: 9 / 19.5;
  border-radius: 1.4rem; overflow: hidden;
  background: var(--bp-bg-inverse); border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 30px 60px -30px rgba(15, 23, 42, 0.65);
}
.hub-device img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}
.hub-device--back { top: 0; right: 1.5rem; transform: rotate(5deg); opacity: 0.92; }
.hub-device--front { bottom: 0; left: 1.5rem; transform: rotate(-4deg); }

/* ── Featured ───────────────────────────────────────────────────────────── */
.hub-featured {
  display: grid; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  border-radius: 1.5rem; text-decoration: none; overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(59, 130, 246, 0.35) 0%, rgba(59, 130, 246, 0) 55%),
    linear-gradient(150deg, var(--bp-bg-inverse) 0%, var(--bp-bg-inverse-2) 100%);
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 22px 55px -34px rgba(15, 23, 42, 0.85);
}
.hub-featured:hover { transform: translateY(-3px); box-shadow: 0 30px 70px -34px rgba(15, 23, 42, 0.95); }
@media (min-width: 780px) {
  .hub-featured { grid-template-columns: minmax(0, 1fr) minmax(0, 0.42fr); }
}
.hub-featured-copy { min-width: 0; }

/* display:block on each: this is what stops the three lines merging. */
.hub-featured-eyebrow {
  display: block;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--bp-accent);
}
.hub-featured-title {
  display: block; margin: 0.6rem 0 0;
  font-family: "Sora", "Manrope", sans-serif; font-weight: 800;
  font-size: clamp(1.4rem, 3.2vw, 2rem); letter-spacing: -0.03em;
  line-height: 1.15; color: #fff; max-width: 18ch;
}
.hub-featured-sub {
  display: block; margin: 0.75rem 0 0;
  font-size: clamp(0.92rem, 0.4vw + 0.85rem, 1rem); line-height: 1.6;
  color: var(--bp-ink-inverse-2); max-width: 46ch;
}
.hub-featured-go {
  display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 1.35rem;
  padding: 0.8rem 1.5rem; border-radius: 0.75rem;
  background: #fff; color: var(--bp-bg-inverse); font-weight: 800; font-size: 0.95rem;
}
.hub-featured-go svg { width: 0.95rem; height: 0.95rem; }
.hub-featured:hover .hub-featured-go { background: var(--bp-accent-soft); }

.hub-featured-media { display: none; }
@media (min-width: 780px) {
  .hub-featured-media {
    display: block; margin-left: auto;
    width: 11rem; aspect-ratio: 9 / 19.5;
    border-radius: 1.4rem; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.85);
    transform: rotate(3deg);
  }
}
.hub-featured-media img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}

/* ── Tool cards ─────────────────────────────────────────────────────────
   Two columns of horizontal cards rather than six identical tiles. At three
   across the screenshots were too small to tell the tools apart, so they read
   as noise; here the shot sits beside the text at a size you can actually
   read, and the row gives the copy room to breathe. */
.hub-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
}
.hub-card {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  overflow: hidden;
  border-radius: var(--bp-r-lg);
  border: 1px solid var(--bpt-border);
  background: var(--bpt-surface);
  text-decoration: none;
  color: var(--bpt-ink);
  transition: transform 0.2s var(--bp-ease), border-color 0.2s var(--bp-ease), box-shadow 0.2s var(--bp-ease);
}
.hub-card:hover,
.hub-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--bp-accent-line);
  box-shadow: var(--bp-shadow-md);
}

/* The shot bleeds off the bottom of its panel, so the phone reads as a device
   rather than a cropped rectangle. */
.hub-card-shot {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(160deg, var(--bp-bg-inverse) 0%, var(--bp-bg-inverse-2) 100%);
  border-right: 1px solid var(--bpt-border);
}
/* Anchored to the panel floor so the phone always bleeds off the bottom
   whatever height the copy beside it gives the row. */
.hub-card-shot img {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 1.15rem;
  bottom: 0;
  display: block;
  width: 6.1rem;
  height: auto;
  min-height: 7.5rem;
  object-fit: cover;
  object-position: top center;
  border-radius: 0.6rem 0.6rem 0 0;
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.9);
}

.hub-card-body {
  display: flex;
  flex-direction: column;
  padding: 1.3rem 1.4rem;
}
.hub-card-name {
  display: block;
  font-family: var(--bp-font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.hub-card-sub {
  display: block;
  margin-top: 0.45rem;
  flex: 1;
  font-size: 0.87rem;
  line-height: 1.55;
  color: var(--bpt-subtle);
}
.hub-card-go {
  display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 1rem;
  font-size: 0.83rem; font-weight: 700; color: var(--bpt-accent-strong);
}
.hub-card-go svg { width: 0.85rem; height: 0.85rem; transition: transform 0.18s ease; }
.hub-card:hover .hub-card-go svg { transform: translateX(3px); }

@media (max-width: 460px) {
  .hub-card { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .hub-card-shot img { width: 4.6rem; margin-top: 0.9rem; }
  .hub-card-body { padding: 1.05rem 1.1rem; }
}

/* ── Explainer ───────────────────────────────────────────────────────────
   The prose ran at half width inside a full-width container, leaving the
   right half of the page empty. Two columns: the headings hold a left rail,
   the prose runs beside them at a proper measure. */
.hub-notes {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: clamp(2rem, 3.5vw, 3rem);
  border-top: 1px solid var(--bpt-border);
}
@media (min-width: 900px) {
  .hub-notes { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); }
}
.hub-notes-head {
  font-family: var(--bp-font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.6rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--bpt-ink);
  max-width: 18ch;
}
@media (min-width: 900px) {
  .hub-notes-head { position: sticky; top: 5.5rem; }
}
.hub-notes-body > p {
  font-size: 0.97rem;
  line-height: 1.7;
  color: var(--bpt-muted);
  max-width: 64ch;
}
.hub-notes-body > p + p { margin-top: 1rem; }
.hub-notes-body > p + h3 { margin-top: 2rem; }
.hub-notes-body h3 {
  font-family: var(--bp-font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--bpt-ink);
  margin-bottom: 0.6rem;
}

@media (prefers-reduced-motion: reduce) {
  .hub-featured, .hub-card, .hub-card-go svg { transition: none; }
  .hub-featured:hover, .hub-card:hover { transform: none; }
}
