/* ===== wb-hero: the page's chooser. Under the head a warm horizon opens and the six kinds of work stand in its
   light on two plinths, each plinth carrying its group's name. The three that start from an idea stand level on
   theirs; the three that start from a system you have climb as solid steps (tests, then features, then the
   rebuild). Blocks are drawn in CSS with a lit top face, a front and a shaded side; a floor runs out under them.
   Each kind is one real link to its block, marked at rest by a small square with a down mark. Nothing moves
   except in answer to the visitor. ===== */
.wb-hero {
  --wb-h-d: 14px;                             /* depth of a block's top face */
  --wb-h-slab: 64px;                          /* the plinth each group stands on */
  --wb-h-step: 80px;                          /* the rise of one step */
  --wb-h-floor: 56px;                         /* floor running out under the plinths */
  --wb-h-edge: color-mix(in oklab, var(--color-dawn) 85%, var(--color-paper-3));
  --wb-h-top: color-mix(in oklab, var(--color-accent-2) 42%, var(--color-paper-3));
  --wb-h-front-1: color-mix(in oklab, var(--color-accent-2) 30%, var(--color-paper-3));
  --wb-h-front-2: var(--color-paper-2);
  --wb-h-side: color-mix(in oklab, var(--color-paper) 70%, var(--color-paper-2));
  position: relative;
  isolation: isolate;
  padding-block: calc(var(--space-xl) + var(--space-md)) var(--wb-h-floor);
}

/* a block: top face, lit edge, front, side, cut by one polygon */
.wb-hero__glabel, .wb-hero__kind--s2 .wb-hero__a::after, .wb-hero__kind--s3 .wb-hero__a::after {
  background:
    linear-gradient(to right, transparent calc(100% - var(--wb-h-d)), var(--wb-h-side) calc(100% - var(--wb-h-d))),
    linear-gradient(to bottom, var(--wb-h-top) var(--wb-h-d), var(--wb-h-edge) var(--wb-h-d), var(--wb-h-edge) calc(var(--wb-h-d) + 1px), transparent calc(var(--wb-h-d) + 1px)),
    linear-gradient(to bottom, var(--wb-h-front-1), var(--wb-h-front-2) 85%);
  clip-path: polygon(0 var(--wb-h-d), var(--wb-h-d) 0, 100% 0, 100% calc(100% - var(--wb-h-d)), calc(100% - var(--wb-h-d)) 100%, 0 100%);
}

/* the floor, edge to edge, running away from the plinths */
.wb-hero::after {
  content: ""; position: absolute; z-index: -2; left: -20%; right: -20%; bottom: 0; height: calc(2.6 * var(--wb-h-floor));
  transform-origin: 50% 100%; transform: perspective(420px) rotateX(62deg);
  background:
    repeating-linear-gradient(90deg, color-mix(in oklab, var(--color-accent-2) 45%, transparent) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(0deg, color-mix(in oklab, var(--color-accent-2) 30%, transparent) 0 1px, transparent 1px 44px),
    linear-gradient(to top, var(--color-paper-2), color-mix(in oklab, var(--color-paper-3) 70%, var(--color-paper-2)));
  -webkit-mask-image: linear-gradient(to top, transparent, var(--color-ink) 70%); mask-image: linear-gradient(to top, transparent, var(--color-ink) 70%);
  pointer-events: none;
}

/* ===== the head: h1 on the left line, its line and the reader link on the right ===== */
.wb-hero__head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--gap-columns); align-items: end; }
.wb-hero h1 { max-width: 13ch; font-size: var(--text-display-s); line-height: 1; letter-spacing: -0.02em; }
.wb-hero__aside { display: grid; gap: var(--space-sm); justify-items: start; padding-bottom: 0.2em; }
.wb-hero__line { max-width: 40ch; font-size: var(--text-lead); line-height: 1.45; color: var(--color-ink-2); }
.wb-hero__read { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--text-md); }

/* ===== the stage: a warm horizon under the head, its light falling on the blocks ===== */
.wb-hero__pick {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--space-xl);
  margin-top: var(--space-xl); padding-top: var(--space-xl);
}
.wb-hero__pick::before {
  content: ""; position: absolute; z-index: -3; top: 0; bottom: calc(-1 * var(--wb-h-floor)); left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter));
  border-top: 1px solid color-mix(in oklab, var(--color-dawn) 80%, var(--color-paper));
  background:
    radial-gradient(60% 34% at 70% 0%, color-mix(in oklab, var(--color-dawn) 34%, transparent), transparent 72%),
    radial-gradient(40% 70% at 76% 0%, color-mix(in oklab, var(--color-dawn-2) 22%, transparent), transparent 70%),
    radial-gradient(95% 40% at 40% 0%, color-mix(in oklab, var(--color-dawn) 12%, transparent), transparent 80%),
    linear-gradient(to bottom, color-mix(in oklab, var(--color-paper-2) 60%, var(--color-paper)), var(--color-paper) 90%);
}
.wb-hero__group { display: grid; grid-template-rows: 1fr auto; min-width: 0; }
.wb-hero__kinds { grid-row: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; margin: 0; padding: 0; list-style: none; }
/* the plinth, with its group's name on its front */
.wb-hero__glabel {
  grid-row: 2; display: flex; align-items: flex-end; height: var(--wb-h-slab); margin: 0;
  padding: 0 calc(var(--wb-h-d) + var(--space-md)) var(--space-md) var(--space-md);
  font-size: var(--text-sm); font-weight: 500; color: var(--color-ink);
}

.wb-hero__kind { min-width: 0; }
.wb-hero__kind--s2 { --wb-h-lift: var(--wb-h-step); }
.wb-hero__kind--s3 { --wb-h-lift: calc(2 * var(--wb-h-step)); }

.wb-hero__a {
  position: relative; display: grid; gap: var(--space-xs); align-content: end;
  min-height: 44px; padding: var(--space-md) var(--space-lg) calc(var(--wb-h-lift, 0px) + var(--space-lg)) var(--space-md);
  color: var(--color-ink); text-decoration: none;
}
.wb-hero__name { font-size: var(--text-title); font-weight: 500; line-height: 1.2; letter-spacing: -0.005em; text-wrap: balance; }
.wb-hero__have { font-size: var(--text-md); line-height: 1.45; color: var(--color-ink-2); text-wrap: pretty; }
/* a raised step: the block under the kind's text */
.wb-hero__kind--s2 .wb-hero__a::after, .wb-hero__kind--s3 .wb-hero__a::after {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: calc(var(--wb-h-lift) + var(--wb-h-d));
}
/* the resting mark: a small square with a down mark, at the foot of each kind */
.wb-hero__a::before {
  content: ""; order: 3; margin-top: var(--space-xs);
  width: 32px; height: 32px; box-sizing: border-box;
  border: 1px solid var(--color-rule-2);
  background:
    linear-gradient(45deg, transparent calc(50% - 0.75px), var(--color-ink-2) calc(50% - 0.75px), var(--color-ink-2) calc(50% + 0.75px), transparent calc(50% + 0.75px)) 9px 11px / 7px 7px no-repeat,
    linear-gradient(-45deg, transparent calc(50% - 0.75px), var(--color-ink-2) calc(50% - 0.75px), var(--color-ink-2) calc(50% + 0.75px), transparent calc(50% + 0.75px)) 15px 11px / 7px 7px no-repeat;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
.wb-hero__a:hover::before { background-color: var(--color-paper-3); border-color: var(--wb-h-edge); transform: translateY(3px); }
.wb-hero__a:hover .wb-hero__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--color-ink-2); }
.wb-hero__a:active .wb-hero__name { color: var(--color-ink-2); }
.wb-hero__a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.wb-hero__a:focus-visible::before { border-color: var(--color-focus); transition: none; }

/* ===== under 72rem: the two groups stack, each still a row of three on its plinth ===== */
@media (max-width: 72rem) {
  .wb-hero { --wb-h-step: 56px; --wb-h-slab: 52px; }
  .wb-hero__pick { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-xl); }
}
@media (max-width: 60rem) {
  .wb-hero__head { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-lg); }
  .wb-hero h1 { font-size: var(--text-section); }
}
/* ===== phones: each group a list over its plinth; the second keeps its climb as an indent per step ===== */
@media (max-width: 40rem) {
  .wb-hero { --wb-h-floor: var(--space-xl); --wb-h-slab: 56px; --wb-h-d: 10px; }
  .wb-hero__kinds { grid-template-columns: minmax(0, 1fr); }
  .wb-hero__kind--s2, .wb-hero__kind--s3 { --wb-h-lift: 0px; }
  .wb-hero__kind--s2 .wb-hero__a::after, .wb-hero__kind--s3 .wb-hero__a::after { content: none; }
  .wb-hero__kind + .wb-hero__kind { border-top: 1px solid var(--color-rule); }
  .wb-hero__a { padding: var(--space-md) var(--space-2xl) var(--space-md) 0; }
  .wb-hero__a::before { position: absolute; right: var(--space-sm); top: calc(50% - var(--space-md)); margin-top: 0; }
  .wb-hero__a:hover::before { transform: translateY(3px); }
  .wb-hero__group--system .wb-hero__kind { margin-left: calc(var(--wb-h-i, 0) * var(--space-lg)); }
  .wb-hero__kind--s2 { --wb-h-i: 1; }
  .wb-hero__kind--s3 { --wb-h-i: 2; }
  .wb-hero__group--system .wb-hero__kind + .wb-hero__kind { border-top-color: var(--wb-h-edge); }
  .wb-hero__glabel { margin-top: var(--space-xs); }
}
@media (prefers-reduced-motion: reduce) { .wb-hero__a::before { transition: none; } }
