/* ==========================================================================
   editorial.css — the secondary-page editorial system (v2 transformation).

   Authority: Web/Kuneo_Full_Site_Creative_Transformation_Prompt_v2_FINAL.md
   (§5 design language, §7 layout modes, §8 hero family, §10 image slots,
    §11 motion, §24 reduced motion, §29 PASS 2).

   Scope: loaded by every SECONDARY route (capabilities, how-we-work,
   partners, about, work, contact, 404, case-study template). The homepage
   does NOT load this file — it keeps its own scene system and is the
   creative benchmark, not a template (§0, §35).

   Naming: `.p-*` = secondary-page editorial primitives. Tokens (colors,
   type scale, motion, shells) come from tokens.css / layout.css and are
   never redefined here.

   Motion policy (§11): secondary pages get ONE principal interaction
   language per route. This file only defines shared micro-interactions
   (bubble + arrow, quiet reveals). No scroll hijacking, no parallax, no
   animation while idle. Reduced motion is an alternate COMPOSITION, never
   just "transitions off" (§24).
   ========================================================================== */

/* ==========================================================================
   §5.1 Typography utilities — editorial scale for secondary routes.
   Heroes and statements are allowed to occupy real viewport space; the
   editorial clamps already mix vw with svh so monumental type stays usable
   on short laptops (§30).
   ========================================================================== */

.p-eyebrow {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.p-eyebrow--blue {
  color: var(--kuneo-blue);
}

/* On Ink, brand blue only reaches ~2.6:1 — switch the accent to Blue 300
   (~8:1). On Kuneo Blue even Blue 300 fails, so the accent goes near-white. */
.p-chapter--ink .p-eyebrow,
.p-hero--ink .p-eyebrow {
  color: var(--blue-300);
}

.p-chapter--blue .p-eyebrow,
.p-hero--blue .p-eyebrow {
  color: rgba(255, 255, 255, 0.86);
}

.p-title--display {
  font-size: var(--fs-editorial-xl);
  font-weight: 800;
  line-height: var(--lh-editorial);
  letter-spacing: var(--tracking-editorial);
}

.p-title--xl {
  font-size: var(--fs-editorial-lg);
  font-weight: 800;
  line-height: var(--lh-editorial);
  letter-spacing: var(--tracking-editorial);
}

.p-title--lg {
  font-size: var(--fs-editorial-md);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.p-title--md {
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: var(--lh-h2);
  letter-spacing: var(--tracking-h2);
}

.p-lede {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  color: var(--gray-500);
  max-width: 52ch;
}

.p-chapter--ink .p-lede,
.p-hero--ink .p-lede {
  color: var(--gray-300);                  /* 9.7:1 on Ink — AA */
}

.p-body {
  color: var(--gray-600);
}

.p-chapter--ink .p-body {
  color: var(--gray-300);
}

/* ==========================================================================
   §7 Chapter rhythm — one shared band system.
   Every secondary route is a sequence of chapters separated by surface
   changes (White / Off White / Ink / Blue), never arbitrary backgrounds.
   ========================================================================== */

.p-chapter {
  background-color: var(--white);
  padding-block: clamp(72px, 10vh, 132px);
}

.p-chapter--tight {
  padding-block: clamp(48px, 6.5vh, 88px);
}

.p-chapter--tint {
  background-color: var(--off-white);
}

.p-chapter--ink {
  background-color: var(--brand-ink);
  color: var(--white);
}

.p-chapter--blue {
  background-color: var(--kuneo-blue);
  color: var(--white);
}

.p-chapter--flush {
  padding-block: 0;
}

/* Chapter head: eyebrow + title + lede as one stack. */
.p-head {
  display: grid;
  gap: var(--space-4);
  margin-bottom: clamp(40px, 7vh, 88px);
}

.p-head--tight {
  margin-bottom: clamp(24px, 4vh, 48px);
}

.p-head h2 {
  max-width: 24ch;
}

/* Generic editorial split: two columns that collapse on narrow viewports.
   Used for image + copy compositions and the human chapter. */
.p-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 88px);
  align-items: start;
}

.p-split--wide-left {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}

.p-split--wide-right {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
}

.p-split--baseline {
  align-items: baseline;
}

@media (max-width: 1023px) {
  .p-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   §8 Hero family — one family, several tempos.
   Every route looks related; no two heroes are carbon copies. Desktop
   targets ~68–86svh when the content earns it (.p-hero--tall); otherwise
   the hero is intentional, not automatically centred.
   ========================================================================== */

.p-hero {
  position: relative;
  background-color: var(--off-white);
  color: var(--brand-ink);
  padding-block: clamp(88px, 13vh, 168px) clamp(64px, 9vh, 128px);
}

.p-hero--plain {
  background-color: var(--white);
}

.p-hero--ink {
  background-color: var(--brand-ink);
  color: var(--white);
}

.p-hero--blue {
  background-color: var(--kuneo-blue);
  color: var(--white);
}

.p-hero__inner {
  display: grid;
  gap: clamp(20px, 3vh, 36px);
  align-content: start;
}

/* Tall variant: THE HERO OWNS THE FIRST SCREEN.
   Used only by /how-we-work/.

   THE FIRST SCREEN CONTRACT (maintainer: "la primera pantalla es para mostrar
   el How we work, con el titulo, subtitulo y esa frase en azul. Modifica eso").
   The hero has to hold the viewport by itself — title, support and the closing
   line — so the chapter that follows can never intrude on the first impression.

   WHAT WENT WRONG, TWICE, IN OPPOSITE DIRECTIONS.
   The first version stretched the block with `align-content: space-between` on a
   ~62svh box. That held the screen but produced 211px of dead air between the
   support line and the closing line, and left the closing line flush against
   the chapter below (measured 0px). The fix for THAT removed the viewport
   height entirely — which solved the spacing and broke the contract: the hero
   now measures 659px on a 900px viewport, so the next chapter shows through
   inside the first screen. That is the bug being fixed here.

   THE CORRECT COMBINATION, AND WHY IT IS NOT A REVERT:
     · the box takes the usable viewport height, so nothing leaks in;
     · `align-content: start` keeps the text block at the top with its own
       rhythm (no space-between, so the 211px hole cannot come back);
     · the closing line is held at the BOTTOM by pushing it with an auto margin,
       which fills whatever space is left instead of inventing a fixed gap.
   The auto margin is the part the earlier attempts were missing: it separates
   the closing line from the block above AND from the chapter below by
   construction, at any viewport height, without a magic number. */
.p-hero--tall {
  /* The usable screen: what remains after the sticky header. `svh` so a mobile
     URL bar does not change the composition mid-scroll. */
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
  padding-block: clamp(72px, 10vh, 132px) clamp(56px, 9vh, 112px);
}

.p-hero--tall .p-hero__inner {
  /* A deliberate stack instead of an accidental one: the eyebrow, title and
     support have spacing of their own.
     `space-between` is what holds the closing line at the bottom of the first
     screen: the inner is the flex child that GROWS, so its two rows (the text
     block and the closing line) are pushed apart by exactly the space left
     over.
     This is NOT the rule that produced the original 211px hole. That one
     stretched a box with no viewport height of its own, so "the space left
     over" was arbitrary. Here the height IS the screen and the hero's own
     bottom padding separates it from the chapter below.
     An `auto` margin cannot do this job: the inner is a GRID, and an auto
     margin centres a grid item inside its row instead of pushing the row down —
     measured, it left the closing line 383px above the frame's bottom. */
  display: grid;
  gap: var(--space-6);
  align-content: space-between;
  flex: 1;
}

.p-hero--tall .p-hero__inner > div {
  display: grid;
  gap: var(--space-4);
}

/* ==========================================================================
   THE FIRST-SCREEN CONTRACT, FOR HEROES WITH NO CLOSING LINE.

   The maintainer, about /work/ and /about/: "la primera pantalla deberia verse
   sola siempre, no importa el size".

   `--tall` above solves this for /how-we-work/, and it does so with a piece of
   that page's composition: a closing line held at the bottom by
   `align-content: space-between` on the inner. /work/ and /about/ have no such
   line — their hero is eyebrow, title, support, and one supporting paragraph —
   so borrowing `--tall` wholesale would either invent a closing line or leave
   the text pinned to the top of an empty screen with the space-between hole
   back again.

   What those two pages need is the simpler half of the same contract: the hero
   owns the usable viewport height, and its content sits where the page's own
   rhythm puts it. That is exactly two declarations, and they are the reason
   this is a separate modifier rather than another branch inside `--tall`.

   WHY `min-height` AND NOT `height`: the requirement is "the hero fills the
   first screen", not "the hero is exactly one screen". A short viewport or a
   long title can legitimately need more than the viewport, and `min-height`
   lets the block grow instead of clipping or overlapping the chapter below.

   MEASURED BEFORE THIS: the hero ran 609-802px against viewports of 720-2160,
   so the next section's top landed 81-1281px inside the fold on 21 of 22
   viewports tested. The one that passed is 360x740, where the hero is taller
   than the screen anyway.
   ========================================================================== */

.p-hero--screen {
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
}

/* The inner grows to fill the box (it is the only child), so the hero's own
   padding stays outside it and the composition keeps the page's rhythm instead
   of being stretched to the edges. `align-content: start` keeps the text at the
   top: with a single row and no second element to push against, `space-between`
   would behave as `start` anyway, and saying so makes the intent explicit. */
.p-hero--screen .p-hero__inner {
  flex: 1;
  align-content: start;
}

/* The support line is the paragraph that follows the title, so it gets the
   extra breath a paragraph needs - 16px is too tight for display type. */
.p-hero--tall .p-hero__support {
  margin-top: var(--space-2);
}

/* The closing line sits at the BOTTOM of the first screen.
   `margin-top: auto` inside the flex column pushes it down, so the gap above it
   is exactly the space that is left over — never a fixed number that happens to
   be right at one viewport height and wrong at another. The bottom padding of
   the hero supplies the separation from the chapter below. */
/* The closing line needs no margin of its own: the grid's `space-between`
   places it, so the gap above it is always the space that is actually left. */

/* On a short viewport a full screen of hero is punishing and the composition
   has no room: the closing line releases and the block simply ends where its
   content does. Only below 700px of height — a laptop at 900 or a phone at 844
   still gets the full screen. */
@media (max-height: 700px) {
  .p-hero--tall {
    min-height: 0;
  }

  .p-hero--tall .p-hero__closing {
    margin-top: clamp(24px, 5vh, 56px);
  }
}

.p-hero__title {
  font-size: clamp(2.75rem, min(7.4vw, 11svh), 7.5rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  /* Deliberate line breaks live in the markup (<br>); the title must never
     wrap because of an arbitrary measure (§8). Only a very generous cap
     protects against a runaway single line on ultra-wide screens. */
  max-width: 100%;
}

/* Long-copy variant: a slightly smaller clamp so a longer H1 still honours
   its deliberate <br> line breaks instead of wrapping a third line (§8,
   "depending on copy length"). Used by /partners/. */
.p-hero__title--long {
  font-size: clamp(2.5rem, min(6.2vw, 10svh), 6.5rem);
}

/* The closing line is the SAME monumental voice as the title but sits at
   the far end of the composition: a statement, not a second heading. */
.p-hero__closing {
  font-size: clamp(2.25rem, min(5.2vw, 8svh), 4.75rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  color: var(--kuneo-blue);
}

.p-hero--ink .p-hero__closing {
  color: var(--blue-300);
}

.p-hero__support {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 1.6;
  color: var(--gray-500);
  max-width: 58ch;
}

.p-hero--ink .p-hero__support {
  color: var(--gray-300);
}

.p-hero__line {
  font-size: var(--fs-body-lg);
  color: var(--gray-600);
  max-width: 46ch;
}

.p-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-8);
  margin-top: clamp(8px, 1.4vh, 16px);
}

@media (max-width: 599px) {
  .p-hero__actions .btn {
    width: 100%;
  }

  /* The first-screen contract holds on a phone too; only the rhythm tightens. */
  .p-hero--tall {
    padding-block: clamp(40px, 7vh, 72px) clamp(32px, 6vh, 56px);
  }
}

/* ==========================================================================
   §10 Image slot system — one universal placeholder, explicit regions.
   Markup contract per slot:
     <div class="p-media p-media--3x2" data-image-slot="capability-cloud">
       <!-- IMAGE SLOT: capability-cloud | replace with final Kuneo asset -->
       <img src="/assets/placeholders/kuneo-image-placeholder.svg"
            alt="" aria-hidden="true" width="1600" height="1000" loading="lazy">
       <span class="p-slot-label" aria-hidden="true">Image slot · capability cloud</span>
     </div>

   Rules: object-fit crop with off-centre support via --image-x/--image-y;
   the final image replaces the placeholder without a layout change; slot
   labels are dev-only and disappear globally with `no-slot-labels` on
   <html> (§10.4); empty slots recompose instead of leaving broken frames
   (§10.6). Art-direction briefs are documented inline at each slot — see
   the comment above each p-media block.
   ========================================================================== */

.p-media {
  position: relative;
  overflow: clip;
  background-color: var(--gray-100);
  /* Every photograph on the site gets a softened corner (maintainer: "no
     queremos vertices, nuestra tipografia es suave, tenemos que ir acorde").
     `overflow: clip` is already here, so the radius clips the image itself and
     the crop never shows a hard corner. Uses the existing card token rather
     than a new value, so the radius stays a system decision. */
  border-radius: var(--radius-card);
}

.p-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--image-x, 50%) var(--image-y, 50%);
}

.p-media--3x2 { aspect-ratio: 3 / 2; }
.p-media--16x10 { aspect-ratio: 16 / 10; }
.p-media--16x9 { aspect-ratio: 16 / 9; }
.p-media--21x9 { aspect-ratio: 21 / 9; }
.p-media--4x5 { aspect-ratio: 4 / 5; }
.p-media--1x1 { aspect-ratio: 1 / 1; }

/* Production mode — the single dev/production switch, carried as
   `no-slot-labels` on <html> (all 9 pages). In production it does two
   things: hides the dev slot labels, and hides image slots that still have
   no asset, so the page never ships an unfinished-looking frame (§10.6).
   Remove that ONE class to enter art-direction mode: every reserved slot
   reappears with its label and its neutral branded surface.

   While the slot is hidden its <img> is hidden too, so the placeholder file
   costs no paint. The final asset replaces the placeholder without a layout
   change (§10.3). */
.no-slot-labels .p-media--empty {
  display: none;
}

/* Dev-only slot label. Hidden in production via the same switch. */
.p-slot-label {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-3);
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.no-slot-labels .p-slot-label {
  display: none;
}

/* ==========================================================================
   §5.4 The directional arrow — the shared Kuneo interaction primitive.
   One implementation serves every "this leads deeper" affordance on the
   site: index rows, the next-chapter band, project links. The shaft draws
   itself while the head travels with it. Decorative only — the parent
   link always carries the accessible name.
   ========================================================================== */

.p-arrow {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 44px;
  /* The default for the STANDALONE uses (`.p-index` rows, editorial links).
     Controls that wrap the arrow override it — see `.p-next__link .p-arrow`. */
  color: var(--kuneo-blue);
}

.p-arrow__shaft {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 22px;
  height: 2px;
  background: currentColor;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 420ms var(--ease-emphasized);
}

.p-arrow__shaft::after {
  content: "";
  position: absolute;
  right: 0;
  top: -4px;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.p-arrow--drawn .p-arrow__shaft {
  transform: scaleX(1);
}

/* ==========================================================================
   §5.4 / §12.2 Editorial index — the bubble + arrow at two scales.
   Default: monumental rows (About standard, partner pillars, work index).
   Compact: the sticky sidebar index used by capability chapters.
   The bubble grows behind the number and the row steps forward — the same
   vocabulary the homepage uses, so both halves of the site read as one
   brand rather than two templates.
   ========================================================================== */

.p-index__list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--gray-200);
}

.p-chapter--ink .p-index__list {
  border-top-color: rgba(255, 255, 255, 0.14);
}

.p-index__row {
  border-bottom: 1px solid var(--gray-200);
  transition: opacity 320ms var(--ease-standard);
}

.p-chapter--ink .p-index__row {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.p-index__link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2vw, 32px);
  padding-block: clamp(16px, 2.4vh, 28px);
  text-decoration: none;
  color: inherit;
}

/* The bubble: a disc behind the number, invisible at rest. On hover, focus
   or active state it grows to full size while the number flips to white. */
.p-index__num {
  position: relative;
  z-index: 0;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--gray-500);
  transition: color 320ms var(--ease-standard), transform 420ms var(--ease-emphasized);
}

.p-chapter--ink .p-index__num {
  color: var(--gray-300);
}

.p-index__num::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius-pill);
  background: var(--kuneo-blue);
  transform: scale(0);
  transition: transform 460ms var(--ease-emphasized);
}

.p-index__link:hover .p-index__num,
.p-index__link:focus-visible .p-index__num,
.p-index__row.is-active .p-index__num {
  color: var(--white);
  transform: scale(1.12);
}

.p-index__link:hover .p-index__num::before,
.p-index__link:focus-visible .p-index__num::before,
.p-index__row.is-active .p-index__num::before {
  transform: scale(1);
}

.p-index__name {
  font-size: clamp(1.75rem, min(4.4vw, 6svh), 3.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  transition: transform 420ms var(--ease-emphasized);
  transform-origin: left center;
}

.p-chapter--ink .p-index__name {
  color: var(--white);
}

/* The arrow draws on approach. */
.p-index__go {
  opacity: 0;
  transform: translateX(-10px);
  transition:
    opacity 240ms var(--ease-standard),
    transform 420ms var(--ease-emphasized);
}

.p-index__link:hover .p-index__go,
.p-index__link:focus-visible .p-index__go,
.p-index__row.is-active .p-index__go {
  opacity: 1;
  transform: translateX(0);
}

.p-index__link:hover .p-arrow__shaft,
.p-index__link:focus-visible .p-arrow__shaft,
.p-index__row.is-active .p-arrow__shaft {
  transform: scaleX(1);
}

/* Active row: name stepped forward, neighbours softened. */
.p-index__list:hover .p-index__row:not(:hover) .p-index__name,
.p-index__list:focus-within .p-index__row:not(:focus-within) .p-index__name {
  opacity: 0.42;
}

.p-index__link:hover .p-index__name,
.p-index__link:focus-visible .p-index__name {
  transform: translateX(clamp(6px, 1vw, 14px));
}

/* Compact variant — the sticky capability index. */
.p-index--compact .p-index__list {
  border-top: 0;
}

.p-index--compact .p-index__row {
  border-bottom: 0;
}

.p-index--compact .p-index__link {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-4);
  padding-block: clamp(10px, 1.4vh, 16px);
}

.p-index--compact .p-index__num {
  width: 2rem;
  height: 2rem;
  font-size: var(--fs-label);
}

.p-index--compact .p-index__name {
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--gray-400);
  transition: transform 420ms var(--ease-emphasized), color 320ms var(--ease-standard);
}

.p-index--compact .p-index__row.is-active .p-index__name {
  color: var(--brand-ink);
}

.p-index--compact .p-index__link:hover .p-index__name,
.p-index--compact .p-index__link:focus-visible .p-index__name {
  color: var(--brand-ink);
  transform: translateX(clamp(4px, 0.8vw, 10px));
}

.p-index--compact .p-index__go {
  width: 28px;
  height: 28px;
}

.p-index--compact .p-arrow__shaft {
  width: 14px;
}

.p-index--compact .p-arrow__shaft::after {
  width: 7px;
  height: 7px;
  top: -3px;
  border-right-width: 1.5px;
  border-bottom-width: 1.5px;
}

.p-index--compact .p-index__list:hover .p-index__row:not(:hover) .p-index__name {
  opacity: 0.55;
}

/* Focus/active rows keep full opacity even while a sibling is hovered. */
.p-index--compact .p-index__list:focus-within .p-index__row:not(:focus-within) .p-index__name {
  opacity: 1;
}

/* ==========================================================================
   §3 One idea surfaces as the strongest statement on the route.
   ========================================================================== */

.p-statement {
  font-size: clamp(2.25rem, min(5.4vw, 8.5svh), 5rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
  max-width: 22ch;
}

.p-statement--blue {
  color: var(--kuneo-blue);
}

.p-chapter--ink .p-statement {
  color: var(--white);
}

.p-chapter--blue .p-statement {
  color: var(--white);
}

/* ==========================================================================
   §21.1 Next chapter — no route ends in an editorial dead end.
   (maintainer: "El See All work no parece un boton, y el de Start a
   Conversation, el texto no esta centrado. Necesitamos mejores botones ahi").

   Two REAL buttons from the site's own `.btn` system, not two text links that
   happen to sit next to each other. The primary takes the brand blue; the
   secondary takes the outlined treatment. Both are true controls: centred
   label, a 48px+ target, a border and a hover state.

   The primary is deliberately larger than the secondary — it is the
   continuation, the secondary is the alternative — but they share a baseline
   because both are `inline-flex` with the same vertical alignment, which is
   what fixes the old drifting-text problem.
   ========================================================================== */

.p-next {
  background-color: var(--white);
  border-top: 1px solid var(--gray-200);
  padding-block: clamp(56px, 8vh, 104px);
}

.p-next--tint {
  background-color: var(--off-white);
}

.p-next--ink {
  background-color: var(--brand-ink);
  border-top-color: rgba(255, 255, 255, 0.14);
  color: var(--white);
}

.p-next__inner {
  display: grid;
  gap: clamp(24px, 3.5vh, 40px);
}

/* Two SIBLING buttons, side by side, both subtle (maintainer: "el See our...
   mucho mas grande que el start conversation. deberian ser botones mas
   sutiles").

   What was wrong: the primary was authored as a monument — `min-height` up to
   92px, display-size type up to 2.5rem, and it stretched across the whole
   `1fr` column (measured 1043px wide at 1440). Next to a 56px outlined button
   that is not a hierarchy, it is two different design languages.

   The fix is to make them the same SIZE and let FILL vs OUTLINE carry the
   hierarchy. That is enough to show which is the continuation without one
   dwarfing the other, and it keeps the band as quiet as its name. */
.p-next__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-4) var(--space-4);
}

/* Shared geometry for both buttons: one height, one type size, one radius, one
   arrow. Declared ONCE here so the two can never drift apart again. */
.p-next__link,
.p-next__secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 52px;                        /* clears the 44px WCAG target */
  padding: 0 clamp(20px, 2vw, 28px);
  font-size: var(--fs-body-lg);            /* 18px — a control, not a headline */
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  border-radius: var(--radius-control);
  white-space: nowrap;
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.p-next__link .p-arrow,
.p-next__secondary .p-arrow {
  width: 24px;
  height: 24px;
  flex: none;
  /* CONSUME THE BUTTON'S COLOUR, do not carry its own.
     `.p-arrow` defaults to Kuneo Blue, which on the filled button (white text
     on Kuneo Blue) produced a BLUE arrow on a BLUE fill — measured 1.00:1, i.e.
     literally invisible, on all six pages with the band. `inherit` makes the
     arrow follow whatever the control decides, so the primary gets a white
     arrow and the outlined secondary gets ink (or white on the ink band)
     without a second rule per variant. */
  color: inherit;
}

.p-next__link .p-arrow__shaft,
.p-next__secondary .p-arrow__shaft {
  width: 14px;
  transform: scaleX(1);
}

/* The primary continuation: the ONLY filled control in the band. That fill is
   the whole hierarchy — no size difference needed. White on Kuneo Blue is
   7.1:1, which is what must pass. */
.p-next__link {
  color: var(--white);
  background-color: var(--kuneo-blue);
}

.p-next__link:hover,
.p-next__link:focus-visible {
  background-color: var(--blue-600);
}

.p-next--ink .p-next__link {
  color: var(--white);
}

/* The secondary: outlined. `--border-strong` is a full shorthand
   (`1px solid #B8C0CC`), so it is consumed with the `border` property —
   `border: 1px solid var(--border-strong)` is invalid and the whole declaration
   is silently dropped. */
.p-next__secondary {
  color: var(--brand-ink);
  background-color: transparent;
  border: var(--border-strong);
}

.p-next__secondary:hover,
.p-next__secondary:focus-visible {
  border-color: var(--kuneo-blue);
  color: var(--kuneo-blue);
  background-color: var(--blue-050);
}

.p-next--ink .p-next__secondary {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.32);
  background-color: transparent;
}

.p-next--ink .p-next__secondary:hover,
.p-next--ink .p-next__secondary:focus-visible {
  color: var(--white);
  border-color: var(--white);
  background-color: rgba(255, 255, 255, 0.08);
}

/* Narrow: stack them, full width, so both stay easy targets. */
@media (max-width: 599px) {
  .p-next__row {
    align-items: stretch;
    flex-direction: column;
  }

  .p-next__link,
  .p-next__secondary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .p-next__link {
    transition: none;
  }
}

/* ==========================================================================
   §19 404 — monumental code + one restrained blue directional gesture.
   Part of the brand, not a forgotten utility page.
   ========================================================================== */

.er-page {
  position: relative;
  background-color: var(--off-white);
  overflow: clip;
  padding-block: clamp(72px, 12vh, 160px) clamp(96px, 16vh, 200px);
}

.er-page__inner {
  display: grid;
  gap: clamp(16px, 3vh, 40px);
}

/* The code is a graphic element: enormous, quiet, blue-marked. */
.er-page__code {
  font-size: clamp(5rem, min(18vw, 26svh), 16rem);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.06em;
  color: var(--gray-200);
  user-select: none;
}

.er-page__copy {
  display: grid;
  gap: var(--space-4);
}

/* The measure cap is expressed against the TITLE's own scale: a `ch` cap on
   this block would resolve at body size and cramp the monumental heading. */
.er-page__copy .p-hero__title {
  max-width: 24ch;
}

.er-page__copy .p-hero__support {
  max-width: 46ch;
}

.er-page__action {
  margin-top: var(--space-4);
}

/* Quiet secondary exits under the one filled action: plain text links, so
   the page keeps a single primary gesture. */
.er-page__exits ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
}

.er-page__exits a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;                        /* WCAG 2.2 AA target */
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--brand-ink);
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition:
    color var(--duration-fast) var(--ease-standard),
    text-decoration-color var(--duration-fast) var(--ease-standard);
}

.er-page__exits a:hover,
.er-page__exits a:focus-visible {
  color: var(--kuneo-blue);
  text-decoration-color: currentColor;
}

@media (prefers-reduced-motion: reduce) {
  .er-page__code {
    color: var(--gray-300);
  }
}

/* ==========================================================================
   §24 / §33 Touch + reduced-motion composition.
   Nothing may depend on hover for discoverability; reduced motion keeps
   every highlight as colour/border and resolves transform-based movement.
   ========================================================================== */

@media (hover: none) {
  .p-index__go,
  .p-index__link .p-arrow__shaft {
    opacity: 1;
    transform: none;
  }

  .p-arrow__shaft {
    transform: scaleX(1);
  }

  .p-index__list:hover .p-index__row:not(:hover) .p-index__name {
    opacity: 1;
  }
}

@media (max-width: 1023px) {
  /* The sticky sidebar index is a desktop composition; on narrow viewports
     the compact index becomes a quiet static list and everything stacked
     below it reads top to bottom (§23). */
  .p-index__go,
  .p-index__link .p-arrow__shaft {
    opacity: 1;
    transform: none;
  }

  .p-index--compact .p-index__go {
    display: none;
  }

  .p-index__name {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* The arrow is a directional STATE, so it renders drawn instead of being
     animated into place. */
  .p-arrow__shaft {
    transform: scaleX(1);
    transition: none;
  }

  .p-index__go {
    opacity: 1;
    transform: none !important;
  }

  .p-index__num,
  .p-index__name {
    transform: none !important;
  }

  .p-index__list:hover .p-index__row:not(:hover) .p-index__name {
    opacity: 1;
  }
}
