/* ============================================================
   MILOVISION - VENTURES (vitrine)

   Additive module. Load it AFTER css/pages.css on ventures.html only:
     <link rel="stylesheet" href="css/ventures.css?v=1" />
   It touches no existing selector outside the page; everything here is
   either a new class or scoped to .page--wide / .page--ventures.

   Relies on tokens and components already in main.css / pages.css:
   --edge, --page-max, --nav-h, --nav-top, --green, --paper,
   --paper-dim, --paper-soft, --orange, --font-light, --font-demi,
   --font-wide, --ease-out, .sheet, .sheet__kicker, .sheet__title,
   .sheet__body, .button, .reveal (+ .has-js from js/pages.js).

   One piece of raw glass per venture. The state of the glass is the
   state of the venture: the selected piece is sharp and lit from
   within; the others rest slightly out of focus. Hover sharpens a
   piece and turns its name ember, but only the click lights it.
   Behaviour lives in js/ventures.js.
   ============================================================ */

/* the vitrine is full-bleed: its row has to reach the screen edge for
   the cut-off fourth tile to read as "there is more". Capped at the
   editorial measure the glass shrinks and the peek becomes a parked
   tile, so this page opts out of --page-max. */
.page--wide { --page-max: 100vw; }

/* VERTICAL RHYTHM, pinned for this page. pages.css gives every
   .page--plate page 6vh above the sheet and takes the title's bottom
   margin to 0 - right for the image plates on About. The vitrine was
   designed with 7vh above and a 4.5vh pause under the title; without
   these two lines the whole page rides 5.5vh higher (59px at 1080). */
.page--ventures .sheet { padding-top: calc(var(--nav-h) + var(--nav-top) + 7vh); }
.page--ventures .sheet__title { margin-bottom: 4.5vh; }

/* ventures: the giant sits a tick smaller and tighter under its kicker */
.sheet__title--tight { font-size: clamp(40px, 4.4vw, 80px); margin-top: -0.6vh; } /* = .vpanel__title: page title and venture name share one size */
.sheet__kicker + .sheet__title--tight { margin-top: -0.6vh; }
.vitrine {
  margin-top: 14vh;
  /* the site's --ease-out is an expo curve: it delivers most of a change
     in the first tenth of its duration, which makes a fade read as a
     switch. The glow and the panel hand-over use this symmetric curve
     instead, so the change passes through the middle where the eye can
     follow it. */
  --ease-glow: cubic-bezier(0.45, 0, 0.55, 1);
}
.sheet__title + .vitrine { margin-top: 1.5vh; }
.vitrine__row {
  --gap: clamp(16px, 1.6vw, 28px);
  list-style: none;
  /* the row runs off the right edge of the SCREEN, not off the sheet:
     that cut-off fourth tile is the invitation to keep going. Since
     .sheet is capped at --page-max and centred, the bleed has to cover
     the sheet padding PLUS whatever page is left beside it. Below
     --page-max the second term is 0 and this is just --edge. */
  --bleed: calc((100vw - min(100vw, var(--page-max, 100vw))) / 2 + var(--edge));
  margin: 0 calc(-1 * var(--bleed)) 0 0;
  padding: 0 var(--bleed) 6px 0;
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.vitrine__row::-webkit-scrollbar { display: none; }
.vitrine__row.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.piece {
  position: relative;
  margin: 0;
  flex: 0 0 calc((100% - 2 * var(--gap)) / 3); /* exactly three on the grid */
  scroll-snap-align: start;
}
.piece__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.piece__btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 6px; }
/* the frame is what goes in and out of focus */
.piece__frame {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--frame-bg, var(--green));
  /* RUHE - one resting look for every piece that is not the chosen one,
     whether or not a choice has been made. Three states, no fourth. */
  filter: blur(2.5px) saturate(0.9);
  opacity: 0.72;
  transform: scale(0.98);
  transition: filter 0.9s var(--ease-out), opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  will-change: filter, opacity, transform;
}
/* GEWAEHLT - sharp, full, and lit from within (see .piece__img--glow) */
.piece.is-active .piece__frame { filter: none; opacity: 1; transform: none; }
/* HOVER - a step toward focus, never all the way: the last step is the
   click. Focus-visible mirrors it so the keyboard sees the same thing. */
@media (hover: hover) {
  .piece:not(.is-active) .piece__btn:hover .piece__frame { filter: blur(0.5px) saturate(1); opacity: 0.95; transform: scale(0.99); }
}
.piece:not(.is-active) .piece__btn:focus-visible .piece__frame { filter: blur(0.5px) saturate(1); opacity: 0.95; transform: scale(0.99); }
/* renders bleed 4% past the frame (they used to float; the glass now
   rests still - the bleed stays so the crop and scale are unchanged) */
.piece__float { position: absolute; inset: -4%; display: block; }
.piece__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }
/* lit from within - ONLY once the piece has been chosen. Hover stays a
   quiet invitation (the frame sharpens, the name turns ember and steps
   up a weight); the light inside the glass is the reward for the click,
   so the row does not flicker as the pointer crosses it. Focus follows
   hover, not selection, for the same reason. */
/* the light takes its time. It starts a beat after the click so the
   frame has already come into focus, then rises over 1.4s - slow enough
   to be read as a change on a phone, where there is no hover to warn
   you it is coming. Going out is quicker (0.7s): when the choice moves
   to another piece the old light should step aside, not linger. */
.piece__img--glow { opacity: 0; transition: opacity 0.7s var(--ease-glow); }
.piece.is-active .piece__img--glow { opacity: 1; transition: opacity 1s var(--ease-glow); }
/* tile label: tracked micro caps, top-left */
.piece__callouts { position: absolute; inset: 0; pointer-events: none; }
.callout {
  position: absolute;
  display: block;
  font-family: var(--font-light);
  font-size: clamp(10px, 0.66vw, 12px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.55;
  color: var(--paper-dim);
  transition: color 0.45s var(--ease-out);
}
.callout--tl { top: 6%; left: 8%; }
.callout strong {
  display: block;
  font-weight: inherit;
  color: var(--paper-soft);
  transition: color 0.45s var(--ease-out);
}
/* the name answers the hover in ember and steps up one weight - it
   keeps its size, so nothing in the row shifts. The selected piece
   holds the same look. (No.63 Medium is not part of the licensed
   package, so Demi is the step above Light here.) */
@media (hover: hover) {
  .piece__btn:hover .callout strong { color: var(--orange); font-family: var(--font-demi); }
}
.piece__btn:focus-visible .callout strong,
.piece.is-active .callout strong { color: var(--orange); font-family: var(--font-demi); }
.piece.is-active .callout,
.piece__btn:hover .callout { color: var(--paper-soft); }

/* ---- strip controls ---- */
.vitrine__nav {
  display: flex;
  justify-content: flex-end; /* the "click the other ventures" hint is gone (16.11.2026), the arrows stay right */
  align-items: baseline;
  margin-top: 2.6vh;
  font-family: var(--font-light);
  font-size: clamp(11px, 0.82vw, 13px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.vitrine__arrows { display: flex; gap: clamp(20px, 2vw, 36px); }
.vitrine__arrow {
  padding: 0 0 0.35em;
  border: 0;
  border-bottom: 1px solid rgba(240, 234, 226, 0.25);
  background: none;
  color: var(--paper-soft);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}
.vitrine__arrow:hover,
.vitrine__arrow:focus-visible { color: var(--paper); border-color: var(--orange); outline: none; }
.vitrine__arrow[disabled] { opacity: 0.3; cursor: default; border-color: rgba(240, 234, 226, 0.25); color: var(--paper-soft); }

/* ---- the label sheet ---- */
.vitrine__panel {
  margin-top: 5.5vh;
  padding-top: 3.5vh;
  border-top: 1px solid rgba(240, 234, 226, 0.16); /* the footer's hairline */
}
.vitrine__panel[hidden] { display: none; }
.vpanel {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(32px, 3.2vw, 64px);
  align-items: start;
}
/* author display:grid would beat the UA's [hidden] rule - restate it */
.vpanel[hidden] { display: none; }
/* switching ventures is a sequence, not a cut: the sheet that is
   leaving fades down and lifts slightly, and only then does the new one
   rise into its place. Both use the symmetric glow curve, so the change
   happens through the middle of the move where the eye can follow it -
   the site's expo --ease-out would land it almost instantly. */
.vpanel.is-out { animation: panelOut 0.3s var(--ease-glow) both; }
.vpanel.is-in { animation: panelIn 0.45s var(--ease-glow) both; }
@keyframes panelOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-8px); } }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.vpanel__head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.vpanel__head .sheet__kicker { margin-bottom: 0; }
.vpanel__count {
  font-family: var(--font-light);
  font-size: clamp(11px, 0.82vw, 13px);
  letter-spacing: 0.16em;
  color: var(--paper-dim);
}
.vpanel__title {
  grid-column: 1 / -1;
  font-family: var(--font-wide);
  font-size: clamp(40px, 4.4vw, 80px);
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0.6vh 0 4.5vh;
}
.vpanel__title--state { color: var(--paper-dim); } /* unnamed - not yet */
.vpanel__lead { grid-column: 1; }
.vpanel__lede {
  font-family: var(--font-light);
  font-size: clamp(18px, 1.45vw, 25px);
  line-height: 1.38;
  color: var(--paper-soft);
  max-width: 24ch;
}
.vpanel__cta { margin-top: 4.5vh; }
.vpanel__link {
  font-family: var(--font-light);
  font-size: clamp(11px, 0.82vw, 13px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-soft);
  border-bottom: 1px solid rgba(240, 234, 226, 0.25);
  padding-bottom: 0.35em;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.vpanel__link:hover { color: var(--paper); border-color: var(--orange); }
/* editorial in two text columns. NOT a column flow: with column-count
   the two columns are independent streams, so the second paragraph on
   the left and the second on the right start at whatever height their
   neighbour happened to end - they never line up. A grid filled
   COLUMN-first keeps the same reading order (down the left, then down
   the right) but puts every paragraph in a row, and a row is as tall
   as its tallest cell, so paragraph n starts on the same line on both
   sides. --rows is set per panel in the markup = ceil(paragraphs / 2). */
.vpanel__body {
  grid-column: 2;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 2), auto);
  grid-auto-flow: column;
  column-gap: clamp(28px, 2.6vw, 43px);
  row-gap: 1.1em;
}
/* .sheet__body p + p carries a top margin; in a grid that would push
   every cell except the first one down inside its row, which is what
   knocked the right column out of line. Same specificity, later in the
   file, so this wins. */
.vpanel__body p,
.vpanel__body p + p { margin: 0; }
/* a panel whose paragraphs differ a lot in length (Veludio) wraps them in
   two .vpanel__col and sets --rows:1: each column then stacks on its own
   with the normal paragraph gap instead of waiting for its row (16.11.2026) */
.vpanel__col p + p { margin-top: 1.1em; }
@media (prefers-reduced-motion: reduce) {
  .piece__frame, .piece__img--glow, .callout, .callout strong { transition: none; }
  .vpanel.is-in,
  .vpanel.is-out { animation: none; }
}
@media (max-width: 1080px) {
  .vpanel__body { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
}
@media (max-width: 900px) {
  .vitrine { margin-top: 10vh; }
  .sheet__title--tight { font-size: clamp(32px, 10vw, 48px); } /* = .vpanel__title on phones */
  .vitrine__row {
    --gap: 14px;
    margin: 0 calc(-1 * var(--bleed));
    padding: 0 var(--bleed) 8px;
    scroll-padding: 0 var(--bleed);
    cursor: default;
  }
  .piece { flex: 0 0 74vw; scroll-snap-align: center; }
  .vitrine__nav { margin-top: 2vh; }
  .vitrine__arrows { display: none; } /* thumbs do this */
  .callout { font-size: 10px; letter-spacing: 0.14em; }
  .vitrine__panel { margin-top: 4vh; }
  .vpanel { grid-template-columns: 1fr; }
  .vpanel__lead, .vpanel__body { grid-column: 1; }
  .vpanel__body { margin-top: 4vh; }
  .vpanel__lede { max-width: none; }
  .vpanel__title { font-size: clamp(32px, 10vw, 48px); margin-bottom: 3.5vh; }
}
