/* =========================================================
   Hub — the central layout: hero + index grid
   ========================================================= */

.hub-hero {
  position: relative;
  min-height: min(100svh, 980px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: calc(var(--nav-h) + 0.5rem) var(--gutter) 1.5rem;
  overflow: clip;
  isolation: isolate;
}
.hub-field {
  position: absolute;
  z-index: -1;
  inset: calc(var(--nav-h) + 4.5rem) 0 auto 0;
  height: 34svh;
  pointer-events: none;
}
.hub-field canvas {
  width: 100%;
  height: 100%;
}
.hub-field.is-static::before {
  content: '</>';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(6rem, 22vw, 18rem);
  color: var(--accent);
  opacity: 0.85;
  letter-spacing: -0.06em;
}
.hub-field.is-static canvas {
  display: none;
}
.hub-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
  color: var(--muted);
}
.hub-top .live-text {
  color: var(--fg);
}
.hub-main {
  align-self: end;
  padding-top: 36svh;
}
.hub-title {
  font-size: var(--fs-hero);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.92;
  font-variation-settings: var(--display-settings);
  max-width: 10ch;
}
.hub-title .serif {
  font-size: 1.04em;
  color: var(--accent);
}
.hub-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.hub-title .line > span {
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  .hub-title .line > span {
    transform: translateY(110%);
    animation: rise 1.1s var(--ease-out) forwards;
    animation-delay: calc(0.15s + var(--i) * 0.09s);
  }
  @keyframes rise {
    to {
      transform: none;
    }
  }
  .hub-top,
  .hub-bottom {
    opacity: 0;
    animation: fade 1s var(--ease-out) 0.9s forwards;
  }
  @keyframes fade {
    to {
      opacity: 1;
    }
  }
}
.hub-bottom {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}
.hub-sub {
  font-size: var(--fs-lead);
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 32em;
  text-wrap: pretty;
}
.hub-sub strong {
  font-weight: 600;
}
.hub-sub a {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1.5px;
}
.hub-sub a:hover {
  color: var(--accent);
}
.hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.hub-scroll {
  display: none;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
}
.hub-scroll i {
  display: block;
  width: 1px;
  height: 3rem;
  background: var(--line-strong);
  overflow: hidden;
  position: relative;
}
@media (prefers-reduced-motion: no-preference) {
  .hub-scroll i::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    animation: drop 2s var(--ease-in-out) infinite;
  }
  @keyframes drop {
    0% {
      transform: translateY(-100%);
    }
    60%,
    100% {
      transform: translateY(100%);
    }
  }
}
@media (min-width: 900px) {
  .hub-hero {
    padding-bottom: 2.5rem;
  }
  .hub-field {
    inset: var(--nav-h) 0 0 auto;
    width: 54%;
    height: auto;
  }
  .hub-main {
    padding-top: 4rem;
  }
  .hub-title {
    max-width: none;
  }
  .hub-bottom {
    grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 0.8fr);
    align-items: end;
    gap: 2rem;
  }
  .hub-scroll {
    display: inline-flex;
    justify-self: end;
  }
}

/* ---------- Index grid ---------- */
.hub-index {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(4rem, 8vw, 7rem);
}
.hub-index-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
  color: var(--muted);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.tile {
  position: relative;
  display: grid;
  align-content: end;
  gap: 0.5rem;
  min-height: 11rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.55s var(--ease-snap), border-color 0.4s, background-color 0.4s;
}
.tile:hover,
.tile:focus-visible {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}
.tile-kicker {
  color: var(--accent);
}
.tile-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variation-settings: var(--display-settings);
}
.tile-text {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 34em;
  text-wrap: pretty;
}
.tile-arrow {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  transition: background-color 0.4s, color 0.4s, transform 0.5s var(--ease-snap);
}
.tile-arrow svg {
  width: 0.9rem;
  height: 0.9rem;
}
.tile:hover .tile-arrow {
  background: var(--fg);
  color: var(--bg);
  transform: rotate(-45deg);
}
.tile-cover {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.tile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 1.2s var(--ease-out), opacity 0.4s;
}
.tile:hover .tile-cover img {
  transform: scale(1.04);
}
.tile-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14, 13, 11, 0.92) 30%, rgba(14, 13, 11, 0.25) 70%, rgba(14, 13, 11, 0.1));
}
.tile--cover {
  color: var(--paper);
  --muted: rgba(242, 237, 227, 0.75);
  --accent: var(--red);
  --line-strong: rgba(242, 237, 227, 0.45);
  --fg: var(--paper);
  --bg: var(--ink);
}
.tile--big {
  grid-column: 1 / -1;
  min-height: 22rem;
}
.tile--accent {
  background: var(--red);
  color: var(--ink);
  border-color: transparent;
  --muted: rgba(14, 13, 11, 0.7);
  --accent: var(--ink);
  --line-strong: rgba(14, 13, 11, 0.5);
  --fg: var(--ink);
  --bg: var(--paper);
}
.tile--ink {
  background: var(--fg);
  color: var(--bg);
  border-color: transparent;
}
.tile-metric {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
  font-variation-settings: var(--display-settings);
}
.tile-metric .unit {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 0.45em;
  color: var(--accent);
  margin-left: 0.15em;
}
.tile .chips {
  margin-top: 0.25rem;
}
.tile--ink .chip,
.tile--cover .chip {
  border-color: rgba(242, 237, 227, 0.3);
  color: var(--paper);
}
.tile--accent .chip {
  border-color: rgba(14, 13, 11, 0.35);
  color: var(--ink);
}
@media (min-width: 900px) {
  .tiles {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(12rem, auto);
    gap: 1rem;
  }
  .tile {
    padding: 1.5rem;
  }
  .tile--big {
    grid-column: span 4;
    grid-row: span 2;
    min-height: 26rem;
  }
  .tile--tall {
    grid-column: span 2;
    grid-row: span 2;
  }
  .tile--w2 {
    grid-column: span 2;
  }
  .tile--w3 {
    grid-column: span 3;
  }
}
@media (max-width: 899px) {
  .tile--accent {
    grid-column: 1 / -1;
  }
}

/* proof strip */
.hub-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  margin-top: 1.5rem;
  color: var(--muted);
}
.hub-strip .chips {
  gap: 0.35rem;
}
