/* Home. Hero: split, the title runs from paper onto the photograph.
   Authored moment: the four channels unfold one after another as you scroll. */

/* ---------- Hero ----------
   DOM order is text then photograph, so the button is reached before the
   photo credit; the photograph is placed first on phones and right on desktop. */
.hero--home__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
.hero--home__fig { grid-column: 1 / -1; grid-row: 1; margin: 0 calc(-1 * var(--gutter)); }
.hero--home__fig .hero__media { height: var(--hero-media-phone); }
.hero--home__fig .cap { padding-inline: var(--gutter); }
.hero--home__text { grid-column: 1 / -1; grid-row: 2; padding-block: var(--s-5) var(--s-7); }
.hero__signoff { margin-top: var(--s-6); padding-top: var(--s-3); border-top: var(--hair) solid var(--rule); max-width: var(--measure-narrow); }
.hero--home .cross::after { content: none; }
/* Two lines, as written: "Commerce in Europe," then "your way." Below 1024 a measure holds the first line;
   from 1024 the title spans the grid (so its light copy is clipped exactly at the photograph) and a line break sets the lines. */
.hero--home h1 { font-size: clamp(3rem, 1rem + 6.4vw, 7.5rem); text-wrap: wrap; max-width: 8.7em; }
.hero__br { display: none; }

@media (min-width: 64em) {
  .hero--home__grid { height: var(--hero-h); min-height: var(--hero-min-h); }
  .hero--home__fig {
    grid-column: 6 / -1; grid-row: 1;
    display: grid; grid-template-rows: minmax(0, 1fr) auto;
    margin: 0 var(--bleed-right) 0 0;
  }
  .hero--home__fig .hero__media { height: auto; min-height: 0; }
  .hero--home__fig .hero__media picture { position: absolute; inset: 0; }
  .hero--home__fig .hero__media::after { content: ""; position: absolute; inset: 0; background: var(--scrim-deep); pointer-events: none; }
  .hero--home__fig .cap { padding-inline: 0 var(--gutter); }
  /* The text layer spans the grid so the title can cross onto the photograph;
     it lets pointer events through so the photo credit stays clickable. */
  .hero--home__text {
    grid-column: 1 / -1; grid-row: 1; position: relative; z-index: var(--z-raise);
    display: grid; grid-template-rows: minmax(0, 1fr) auto; align-items: end;
    padding-block: var(--s-6) 0;
    pointer-events: none;
  }
  .hero--home__text :is(a, button, h1, p) { pointer-events: auto; }
  .hero--home__copy { padding-bottom: var(--s-8); }
  /* The sign-off sits on the same line as the photo caption, closing the hero */
  .hero__signoff { grid-row: 2; margin: 0; padding-top: var(--s-3); border-top: 0; max-width: var(--cols-4); }
  .hero--home h1 { max-width: none; }
  .hero__br { display: inline; }
  .hero--home .cross::after {
    content: attr(data-text);
    content: attr(data-text) / "";
    white-space: pre-line;   /* the copy carries the same line break as a newline */
    clip-path: inset(0 0 0 var(--col-6-start));
  }
  .hero--home .hero__lead, .hero--home .actions { max-width: var(--cols-5); }
}

/* ---------- Routes: three entry points on stone, the lead route twice as wide ----------
   Entering Europe is the main audience, so it leads at h2 size; the two
   other routes share the remaining half at the large item size. */
.triptych { row-gap: var(--s-7); }
.triptych__item { grid-column: span 3; }
.triptych__item--lead { grid-column: span 6; }
.triptych__link {
  display: grid; gap: var(--s-4); align-content: start; height: 100%;
  padding-top: var(--s-4); border-top: var(--hair) solid var(--ink);
  color: inherit; text-decoration: none;
}
.triptych__title {
  font: var(--wt-display) var(--fs-title) / var(--lh-h2) var(--font-display);
  font-stretch: var(--wd-display); letter-spacing: var(--tr-h2); color: var(--ink);
  transition: color var(--t-quick) var(--ease-out), transform var(--t-base) var(--ease-out);
}
.triptych__item--lead .triptych__title { font-size: var(--fs-h2); }
.triptych__item--lead .triptych__link { padding-right: var(--s-9); border-top-width: var(--rule-heavy); }
.triptych__text { color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small); max-width: var(--measure-narrow); }
.triptych__link > .i { color: var(--ink); transition: transform var(--t-quick) var(--ease-out), color var(--t-quick) var(--ease-out); }
.triptych__link:hover .triptych__title, .triptych__link:focus-visible .triptych__title { color: var(--accent); transform: translateX(var(--s-2)); }
.triptych__link:hover > .i { color: var(--accent); transform: translateX(var(--s-1)); }
.triptych__link:active { transform: translateY(var(--press-y)); }
@media (max-width: 63.99em) { .triptych__item, .triptych__item--lead { grid-column: 1 / -1; } .triptych__item--lead .triptych__link { padding-right: 0; } .triptych { row-gap: var(--s-6); } }

/* ---------- Planner: one instrument ----------
   The questions (input) and the route (output) share one sheet under a 2px ink rule:
   the questions on the lightest paper, the route one tone deeper, a hairline between them. */
.planner {
  --split: calc(7 / 12 * 100%);
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start;
  border: var(--hair) solid var(--rule); border-top: var(--rule-heavy) solid var(--ink);
  background: linear-gradient(90deg, var(--paper-light) var(--split), var(--rule) var(--split) calc(var(--split) + var(--hair)), var(--stone) calc(var(--split) + var(--hair)));
}
.planner__questions { display: grid; gap: var(--s-7); padding: var(--s-7) var(--s-7) var(--s-8); }
.planner__sheet { position: sticky; top: calc(var(--nav-h) + var(--s-5)); padding: var(--s-6) var(--s-6) var(--s-7); }

/* Each question is a numbered step: the numeral turns into a check once it is answered */
.planner__q { margin: 0; padding: 0; border: 0; min-width: 0; }
.planner__q legend { padding: 0; margin-bottom: var(--s-4); width: 100%; }
.planner__legend { display: grid; grid-template-columns: var(--s-8) minmax(0, 1fr); column-gap: var(--s-2); row-gap: var(--s-1); align-items: baseline; }
.planner__num { grid-row: 1 / span 2; position: relative; align-self: start; padding-top: var(--s-1); }
.planner__num .t-num { display: block; transition: opacity var(--t-quick) var(--ease-out); }
.planner__num .i { position: absolute; left: 0; top: var(--s-2); width: var(--s-6); height: var(--s-6); color: var(--accent); opacity: 0; transform: scale(0.6); transition: opacity var(--t-quick) var(--ease-out), transform var(--t-base) var(--ease-out); }
.planner__q.is-done .planner__num .t-num { opacity: 0; }
.planner__q.is-done .planner__num .i { opacity: 1; transform: none; }
.planner__qtitle { font: var(--wt-h3) var(--fs-h3) / var(--lh-h3) var(--font-display); letter-spacing: var(--tr-h3); color: var(--ink); text-wrap: balance; }
.planner__qhint { grid-column: 2; font: var(--wt-medium) var(--fs-micro) / var(--lh-micro) var(--font-sans); letter-spacing: var(--tr-micro); text-transform: uppercase; color: var(--ink-3); }
.planner__q .opts { padding-left: calc(var(--s-8) + var(--s-2)); }

/* Step indicator: three segments that fill in the accent as the questions are answered */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-1); width: 100%; }
.steps > span { height: var(--rule-heavy); background: var(--rule-strong); transition: background-color var(--t-base) var(--ease-out); }
.steps > span.is-done { background: var(--accent); }
.planner__steps { margin: calc(-1 * var(--s-2)) 0 var(--s-4); }

/* Below 1024px a slim strip with the indicator stays under the nav while the questions are
   answered, and lets go where the questions end and the route begins */
.planner__status {
  position: sticky; top: var(--nav-h); z-index: var(--z-raise);
  margin: calc(-1 * var(--s-6)) calc(-1 * var(--gutter)) 0;
  display: grid; gap: var(--s-2); padding: var(--s-3) var(--gutter);
  background: var(--paper-light); border-bottom: var(--hair) solid var(--rule);
  font: var(--wt-medium) var(--fs-small) / var(--lh-small) var(--font-sans); color: var(--ink);
}
.planner__jump { display: none; }
@media (min-width: 64em) { .planner__status { display: none; } }
.ticket__row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); column-gap: var(--s-4); padding-block: var(--s-3); border-bottom: var(--hair) solid var(--rule); }
.ticket dt { padding-top: var(--s-1); }
/* On phones each label sits above its answer, so the answers keep the full width */
@media (max-width: 47.99em) { .ticket__row { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-1); } }
.ticket dd { font: var(--wt-medium) var(--fs-caption) / var(--lh-small) var(--font-serif); color: var(--ink); }
.ticket dd.is-pending { font-style: italic; color: var(--ink-3); }
.ticket dd.is-set { animation: settle var(--t-base) var(--ease-out); }
@keyframes settle { from { opacity: 0.2; transform: translateY(var(--s-1)); } to { opacity: 1; transform: none; } }
.planner__note { margin-bottom: var(--s-5); }
.planner__hint { margin-top: var(--s-3); color: var(--ink-3); }
/* Clearing is a quiet text action under the sheet, drawn disabled until there is something to clear */
.planner__reset {
  display: inline-flex; align-items: center; min-height: var(--control-h-sm); margin-top: var(--s-2); padding: 0;
  background: none; border: 0; cursor: pointer; color: var(--ink-2);
  font: var(--wt-medium) var(--fs-small) / 1.2 var(--font-sans);
  text-decoration: underline; text-decoration-thickness: var(--hair); text-underline-offset: 0.22em; text-decoration-color: var(--rule-strong);
  transition: color var(--t-quick) var(--ease-out), text-decoration-color var(--t-quick) var(--ease-out);
}
.planner__reset:hover { color: var(--accent); text-decoration-color: currentColor; }
.planner__reset:disabled { color: var(--ink-3); text-decoration-color: var(--rule); cursor: not-allowed; }
/* The sheet only sticks when the window can hold all of it */
@media (max-height: 52em) { .planner__sheet { position: static; } }
@media (max-width: 63.99em) {
  /* stacked: the questions on the light sheet, the route below on paper, the sheet running to the window edges */
  .planner { grid-template-columns: minmax(0, 1fr); margin-inline: calc(-1 * var(--gutter)); border-inline: 0; background: var(--paper-light); }
  .planner__questions { padding: var(--s-6) var(--gutter) var(--s-7); }
  .planner__sheet { position: static; padding: var(--s-6) var(--gutter) var(--s-7); background: var(--stone); border-top: var(--hair) solid var(--rule); }
  .planner__jump { display: inline-flex; }
  .planner__legend { grid-template-columns: var(--s-7) minmax(0, 1fr); }
  .planner__q .opts { padding-left: 0; }
}

/* ---------- One model: text overlaps the photograph's corner ---------- */
.model__grid { align-items: end; }
.model__fig { grid-column: 1 / span 8; grid-row: 1; }
.model__fig .fig__media { aspect-ratio: 3 / 2; }
.model__fig .cap { padding-right: var(--cols-4); justify-content: flex-start; }
.model__text { grid-column: 8 / -1; grid-row: 1; position: relative; z-index: var(--z-raise); background: var(--paper); padding: var(--s-6) 0 0 var(--s-6); margin-bottom: calc(-1 * var(--s-9)); }
@media (max-width: 63.99em) {
  .model__fig, .model__text { grid-column: 1 / -1; }
  .model__text { grid-row: 2; margin: 0; padding: var(--s-6) 0 0; }
  .model__fig .cap { padding-right: 0; }
}

/* ---------- Channels: sticky stage, four steps ---------- */
.channels { overflow-x: clip; }
.channels__track { align-items: start; }
.channels__stage { grid-column: 1 / span 6; display: grid; gap: var(--s-4); }
.channels__fig .fig__media { aspect-ratio: 4 / 5; }
.channels__steps { grid-column: 8 / -1; container-type: inline-size; }
.channels__step { padding-block: var(--s-6); border-top: var(--hair) solid var(--rule); }
.channels__step .t-num { display: block; margin-bottom: var(--s-4); }
.channels__name {
  font: var(--wt-display) var(--fs-display-2) / var(--lh-display) var(--font-display);
  font-stretch: var(--wd-display); letter-spacing: var(--tr-display);
  margin-bottom: var(--s-4); text-wrap: balance;
}
/* Sized to its column, not the window, so the longest word ("Marketplaces,") always fits on one line */
.channels__name { font-size: min(var(--fs-display-2), 16.5cqi); overflow-wrap: normal; }
.channels__step p { max-width: var(--measure-narrow); }
.channels__progress { height: var(--rule-heavy); background: var(--rule); }
.channels__progress span { display: block; height: 100%; background: var(--night-accent); transform-origin: 0 50%; transform: scaleX(calc((var(--active, 0) + 1) / 4)); transition: transform var(--t-slow) var(--ease-out); }

/* With JavaScript and enough height: one sticky stage, the photographs stacked */
@media (min-height: 40em) {
  .js .channels__stage { position: sticky; top: calc(var(--nav-h) + var(--s-5)); display: grid; grid-template-areas: "stage"; }
  .js .channels__fig { grid-area: stage; align-self: start; }
  .js .channels__fig .fig__media { aspect-ratio: auto; height: var(--channel-stage-h); }
  .js .channels__progress { grid-area: stage; align-self: end; margin-bottom: calc(-1 * var(--s-5)); }
  /* Only the showing photograph's caption is visible and focusable */
  .js .channels__fig .cap { opacity: 0; visibility: hidden; transition: opacity var(--t-quick) var(--ease-out), visibility 0s linear var(--t-quick); }
  .js .channels__fig.is-active .cap { opacity: 1; visibility: visible; transition-delay: 0s; }
  .js .channels__fig.is-active { z-index: var(--z-raise); }
  .js .channels__step { min-height: var(--channel-step-h); display: flex; flex-direction: column; justify-content: center; }
  .js .channels__step .channels__name { opacity: var(--o-inactive); transition: opacity var(--t-base) var(--ease-out), transform var(--t-slow) var(--ease-out); }
  .js .channels__step.is-active .channels__name { opacity: 1; }
}
@media (min-height: 40em) and (prefers-reduced-motion: no-preference) {
  .js .channels__fig .fig__media { clip-path: inset(100% 0 0 0); transition: clip-path var(--t-slow) var(--ease-in-out); }
  .js .channels__fig.is-active .fig__media, .js .channels__fig.is-past .fig__media { clip-path: inset(0 0 0 0); }
  .js .channels__fig img { transform: scale(var(--zoom-reveal)); transition: transform var(--t-reveal) var(--ease-out); }
  .js .channels__fig.is-active img { transform: none; }
  .js .channels__step .channels__name { transform: translateX(var(--s-5)); }
  .js .channels__step.is-active .channels__name { transform: none; }
}
/* Reduced motion: the photographs cross-fade instead of rising in */
@media (min-height: 40em) and (prefers-reduced-motion: reduce) {
  .js .channels__fig { opacity: 0; }
  .js .channels__fig.is-active { opacity: 1; }
}
/* Short viewports (zoomed in, landscape phones): no sticky stage; the four
   photographs sit as a contact sheet above the steps, so nothing covers the text */
@media (max-height: 39.99em) {
  .channels__stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channels__progress { display: none; }
}
html:not(.js) .channels__stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html:not(.js) .channels__progress { display: none; }

@media (max-width: 63.99em) {
  .channels__stage, .channels__steps { grid-column: 1 / -1; }
  .channels__steps { margin-top: var(--s-6); }
}
@media (max-width: 63.99em) and (min-height: 40em) {
  .channels__steps { margin-top: 0; }
  .js .channels__stage { top: var(--nav-h); z-index: var(--z-raise); background: var(--night); padding-bottom: var(--s-4); }
  .js .channels__fig .fig__media { height: var(--channel-stage-phone); }
  .js .channels__fig .cap { display: none; }
  .js .channels__fig.is-active .cap { display: flex; }
  .js .channels__step { min-height: var(--channel-step-phone); }
}

/* ---------- Control cycle (stone): the five steps, then the board as a sheet ---------- */
.cycle__loop { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-6); font: italic var(--wt-medium) var(--fs-lead) / var(--lh-lead) var(--font-serif); color: var(--ink); }
.cycle__loop .i { color: var(--accent); }
.cycle__pair { margin-top: var(--s-8); row-gap: var(--s-8); align-items: start; }
.cycle__board { grid-column: 1 / span 7; }
.cycle__facts { grid-column: 9 / -1; display: grid; gap: var(--s-7); }
.cycle__fact { display: grid; gap: var(--s-3); justify-items: start; }
.cycle__fact p { color: var(--ink-2); }
/* The measures every report covers: words, not figures, two columns under hairlines */
.measures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-5); width: 100%; }
.measures li { padding-block: var(--s-2); border-top: var(--hair) solid var(--rule); font: var(--wt-medium) var(--fs-small) / var(--lh-small) var(--font-sans); color: var(--ink); }
@media (max-width: 63.99em) { .cycle__board, .cycle__facts { grid-column: 1 / -1; } }

/* ---------- Modules: an image-led index ----------
   A stage of five photographs on the left holds the one that belongs to the
   module under the pointer or focus; the index runs on the right. The first
   photograph shows by default, so the composition is complete without hover. */
.index-stage { align-items: start; row-gap: var(--s-6); }
.index-stage__figs { grid-column: 1 / span 5; display: grid; grid-template-areas: "stage"; align-self: start; }
.index-stage__fig { grid-area: stage; opacity: 0; transition: opacity var(--t-base) var(--ease-out); }
.index-stage__fig.is-active { opacity: 1; z-index: var(--z-raise); }
.index-stage__fig .fig__media { aspect-ratio: 4 / 5; }
.index-stage__body { grid-column: 7 / -1; }
.index-stage__list .index__row { grid-template-columns: minmax(0, 1fr) var(--s-6); row-gap: var(--s-2); padding-block: var(--s-5); }
.index-stage__list .index__text { grid-column: 1; max-width: var(--measure-narrow); }
.index-stage__list .index__row > .i { grid-row: 1; grid-column: 2; }
@media (min-width: 64em) {
  .index-stage__figs { position: sticky; top: calc(var(--nav-h) + var(--s-5)); }
  .index-stage__list .index__row { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) var(--s-6); row-gap: 0; }
  .index-stage__list .index__text { grid-column: 2; }
  .index-stage__list .index__row > .i { grid-column: 3; }
}
@media (max-width: 63.99em) {
  .index-stage__figs, .index-stage__body { grid-column: 1 / -1; }
  .index-stage__fig .fig__media { aspect-ratio: 3 / 2; }
  .index-stage__fig:not(.is-active) { display: none; }
}
