/* Case study pages (MX Master 4 first; future projects reuse the same
   building blocks). Measurements come from the Figma "Frame 7" design,
   which is 1280px wide with 52–62px side margins. */

.case {
  --case-gutter: clamp(20px, 4.85vw, 62px); /* 62px at 1280px wide */
  --case-width: 1156px;                     /* content width in Figma */
  padding-top: 20px;
}

/* A centred content column, used by most blocks. */
.case-block,
.case-title {
  width: 100%;
  max-width: calc(var(--case-width) + 2 * var(--case-gutter));
  margin-inline: auto;
  padding-inline: var(--case-gutter);
}

/* ---------- Title + award ---------- */

.case-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 42px;
  padding-inline: clamp(20px, 4vw, 52px);
}

.case-title h1 {
  flex: 1;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(40px, 5.5vw, 70px);
  line-height: 1.24;
  letter-spacing: -0.03em; /* -2.1px at 70px */
}

.case-title__award {
  width: auto;
  height: clamp(56px, 6.8vw, 87px);
}

/* ---------- Cover ---------- */

.case-cover {
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-top: 1px solid var(--color-text);
  border-bottom: 1px solid var(--color-text);
  padding-top: 20px;
  margin-bottom: 40px;
}

.case-cover__meta {
  display: flex;
  line-height: 16px; /* fixed so this row and the chapter bar match exactly */
  justify-content: space-between;
  gap: var(--space-sm);
  padding-inline: clamp(20px, 4vw, 52px);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-text);
  margin-bottom: 0;
}

.case-cover__media {
  aspect-ratio: 1166 / 605;
  overflow: hidden;
  margin-bottom: 20px;
}

.case-cover__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Section intro: big title + indented paragraph ---------- */

.case-block {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-block: 40px;
}

.case-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.case-intro h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 32px;
  line-height: normal;
  letter-spacing: -0.01em;
}

.case-intro p,
.card figcaption,
.research p,
.learn-more li,
.features__labels li {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 16px;
  line-height: normal;
  letter-spacing: -0.01em;
}

.case-intro p {
  max-width: calc(738px + 30px);
  padding: 0 0 25px 30px;
}

/* The intro is followed by its cards 10px later, not 40px. */
.case-intro + .card-row {
  margin-top: -30px;
}

.case-rule {
  border: 0;
  border-top: 1px solid var(--color-text);
  margin: 0;
}

/* ---------- Image cards with captions ---------- */

.card-row {
  display: grid;
  gap: 10px;
}

.card-row--4 { grid-template-columns: repeat(4, 1fr); }
.card-row--3 { grid-template-columns: repeat(3, 1fr); }
.card-row--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.card img,
.card video {
  width: 100%;
  aspect-ratio: 282 / 435;
  object-fit: cover;
  background: #f3f3f3;
}

.card-row--3 .card img { aspect-ratio: 380 / 435; }
.card--tall img { aspect-ratio: 574 / 575; }

/* "FRAME", "ENVISION"… the orange word that starts each caption. */
.card__label {
  display: block;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-signal-text);
}

/* The smaller 12px orange label used under principles and photos. */
.card__small-label {
  display: block;
  font-weight: 700;
  color: var(--color-signal-text);
  margin-bottom: 4px;
}

/* ---------- User research rows ---------- */

.research {
  display: grid;
  grid-template-columns: 277px 1fr;
  gap: 15px;
  align-items: start;
}

.research__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  color: var(--color-signal-text);
}

.research__media--garden {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.research__media--garden img {
  width: 100%;
  aspect-ratio: 412 / 460;
  object-fit: cover;
}

.research__media--garden .research__wide {
  grid-column: 1 / -1;
  aspect-ratio: 834 / 398;
}

.research__testing {
  width: 100%;
  aspect-ratio: 1280 / 918;
  object-fit: cover;
}

/* "Learn more" accordion: closed by default, opens to show the impact. */
.learn-more {
  margin-top: 10px;
}

.learn-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-text);
  cursor: pointer;
  list-style: none;
}

.learn-more summary::-webkit-details-marker { display: none; }

/* The little chevron on the right, drawn with two borders. */
.learn-more summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.learn-more[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.learn-more summary:hover {
  color: var(--color-signal-text);
}

.learn-more ul {
  list-style: disc;
  padding: 10px 0 0 24px;
}

/* ---------- Key new features diagram ---------- */

.features {
  display: flex;
  justify-content: center;
}

.features__diagram {
  position: relative;
  width: 100%;
  max-width: 895px;
  aspect-ratio: 895 / 523;
}

.features__mouse {
  position: absolute;
  left: 29.44%;
  top: 0;
  width: 39.25%;
  height: 100%;
  cursor: pointer;
  /* Figma "Shadow" variant: drop shadow 24 / 32, blur 73, 40% black.
     Starts invisible and fades in on hover (Smart Animate, ease-out, 0.3s). */
  filter: drop-shadow(24px 32px 36px rgba(0, 0, 0, 0));
  transition: filter 0.3s ease-out;
}

.features__mouse img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* The same mouse with its green LED on, cross-faded in on hover. */
.features__mouse-on {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.features__mouse:hover {
  filter: drop-shadow(24px 32px 36px rgba(0, 0, 0, 0.4));
}

.features__mouse:hover .features__mouse-on {
  opacity: 1;
}

/* Touch screens can't hover, so show the "on" state straight away. */
@media (hover: none) {
  .features__mouse { filter: drop-shadow(24px 32px 36px rgba(0, 0, 0, 0.4)); }
  .features__mouse-on { opacity: 1; }
}

.features__line {
  position: absolute;
  height: 1px;
  background: #9a9a9a;
}

.features__labels li {
  position: absolute;
  white-space: nowrap;
}

/* Two-line labels have a set width in the HTML and wrap inside it. */
.features__labels li[style*="width"] {
  white-space: normal;
}

/* ---------- Key new features: burst-out animation ----------
   js/features-reveal.js adds "will-reveal" (start state: labels hidden
   behind the mouse, lines at zero length) and then "is-revealed" when
   the diagram scrolls into view. Without JavaScript, or with reduced
   motion turned on, none of this applies and everything just shows. */
.features__mouse { z-index: 2; } /* labels slide out from behind it */

.will-reveal .features__labels li {
  opacity: 0;
  transform: translateX(var(--dx, 0)) scale(0.6);
}

.will-reveal .features__line {
  transform: scaleX(0);
  transform-origin: right center; /* grows outwards, away from the mouse */
}

.will-reveal .features__line.is-right {
  transform-origin: left center;
}

.will-reveal .features__mouse {
  transform: scale(0.94);
}

.is-revealed .features__labels li {
  opacity: 1;
  transform: none;
  transition:
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) var(--delay, 0ms),
    opacity 0.5s ease-out var(--delay, 0ms);
}

.is-revealed .features__line {
  transform: none;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--delay, 0ms);
}

/* A small "push" of the mouse just before the labels burst out. */
.is-revealed .features__mouse {
  animation: features-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes features-pop {
  from { transform: scale(0.94); }
  to   { transform: scale(1); }
}

/* ---------- The Big Idea videos ---------- */

.rounded-media {
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
  background: #000;
}

.rounded-media--bigidea  { aspect-ratio: 1156 / 644; }
.rounded-media--showreel { aspect-ratio: 1156 / 647; }

/* The two videos sit 40px apart, like everything else in the section. */

/* ---------- Dark sideways-scrolling strips ---------- */

.strip {
  position: relative;
  background: #444;
  color: #ffffff;
  padding-block: 20px;
}

.strip__viewport {
  position: relative;
  overflow-x: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: #777 transparent;
  cursor: grab;
}

.strip__viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.strip__viewport:focus-visible {
  outline: 2px solid var(--color-signal);
  outline-offset: -2px;
}

/* Soft fade on the right edge, hinting there's more to scroll to.
   It disappears once you reach the end. */
.strip__viewport {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 54px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 54px), transparent);
}

.strip.is-at-end .strip__viewport {
  -webkit-mask-image: none;
          mask-image: none;
}

.strip__track {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
}

.strip__track--cards {
  gap: 23px;
  align-items: flex-start;
}

.strip__track--gap10 {
  gap: 10px;
}

/* ---------- Blueprint cards inside the strips ----------
   Each card is the exact Figma size and its contents are placed at the
   Figma positions, so nothing gets rescaled. Titles, labels and
   paragraphs are real text; only drawings and photos are images. */

.bp-card {
  position: relative;
  flex: none;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  color: var(--color-text);
}

.bp-card--grey {
  background: #f5f5f5;
}

.bp-abs,
.bp-title,
.bp-text,
.bp-col,
.bp-waves,
.bp-rule,
.bp-legend,
.bp-tip {
  position: absolute;
  margin: 0;
}

.bp-abs {
  height: auto;
}

/* Card title: purple number badge + small uppercase label. */
.bp-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 1;
}

.bp-badge {
  display: inline-grid;
  place-items: center;
  width: 16.6px;
  height: 16.6px;
  border-radius: 50%;
  background: #7545f9;
  color: #ffffff;
  font-size: 10px;
  letter-spacing: 0;
}

.bp-text,
.bp-col--usecase figcaption {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 16px;
  line-height: normal;
  letter-spacing: -0.01em;
}

/* An image with a rule and a small label underneath. */
.bp-col img {
  display: block;
  width: 100%;
  height: auto;
}

.bp-col figcaption {
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid var(--color-text);
}

.bp-col--usecase figcaption .small-title {
  display: block;
  margin-bottom: 7px;
}

/* Waveform library: 5 × 4 grid of grey tiles. */
.bp-waves {
  display: grid;
  grid-template-columns: repeat(5, 152px);
  column-gap: 3.94px;
  row-gap: 3px;
}

.bp-waves li {
  height: 76.15px;
  background: #ececec;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bp-waves img {
  width: 152px;
  height: 46px;
}

.bp-waves .small-title {
  margin-top: 2px;
}

.bp-rule {
  border: 0;
  border-top: 1px solid var(--color-text);
}

/* Heatmap legend. */
.bp-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 11px;
}

.bp-legend li {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bp-legend span {
  width: 14.6px;
  height: 14.6px;
  border-radius: 50%;
}

/* Dark tooltips on the icon grid, with a small pointer arrow. */
.bp-tip {
  display: flex;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.1));
  z-index: 1;
}

.bp-tip > span {
  position: relative;
  padding: 4px 8px;
  border-radius: 2px;
  background: #222425;
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  line-height: 14px;
  white-space: nowrap;
}

.bp-tip > span::after {
  content: "";
  position: absolute;
  border: 4px solid transparent;
}

.bp-tip--right { justify-content: flex-end; padding-right: 4px; }
.bp-tip--right > span::after { left: 100%; top: 50%; transform: translateY(-50%); border-left-color: #222425; }

.bp-tip--left { justify-content: flex-start; padding-left: 4px; }
.bp-tip--left > span::after { right: 100%; top: 50%; transform: translateY(-50%); border-right-color: #222425; }

.bp-tip--down { justify-content: flex-start; padding-bottom: 4px; }
.bp-tip--down > span::after { top: 100%; left: 50%; transform: translateX(-50%); border-top-color: #222425; }

/* Software flow screenshots keep their Figma size (503px tall) on every
   screen, so their text never shrinks; the strip just scrolls further. */
.flow > img {
  height: 503px;
  width: auto;
}

.strip img {
  -webkit-user-drag: none;
}

.strip__caption {
  padding: 20px 60px;
  max-width: 519px;
}

.strip__label {
  display: block;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.strip__caption p,
.note p {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 16px;
  line-height: normal;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.strip__caption p {
  max-width: 427px;
}

/* Software flow screen + its side notes. */
.flow {
  display: flex;
  align-items: center;
}

.flow--end {
  align-items: flex-end;
}

.flow__notes {
  display: flex;
  flex-direction: column;
  gap: 41px;
  width: 189px;
  padding-left: 20px;
  box-sizing: content-box;
}

.flow__notes--spread {
  gap: 106px;
}

.flow--end .flow__notes {
  padding-block: 20px;
}

.note {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* The small white triangle pointing back at the screen. */
.note__title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ffffff;
}

.note__title::before {
  content: "";
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 5px solid #ffffff;
}

/* ---------- Telling the product design story ---------- */

.story__media {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: -30px; /* sits 10px under the intro, like in Figma */
}

.story__media img,
.story__media video {
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
}

.story__wide--keynote  { aspect-ratio: 1156 / 644; }
.story__wide--briefing { aspect-ratio: 1156 / 595; }

.story__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.story__row img {
  aspect-ratio: 379 / 580;
}

/* ---------- Selected press ---------- */

.press {
  gap: 20px;
  padding-bottom: 200px;
}

.press__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.press__item {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

/* The coloured quote cards. Each one opens the article in a new tab. */
.press__card {
  display: block;
  min-height: 371px;
  padding: 29px 34px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 32px;
  line-height: normal;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.press__card--jp {
  font-weight: 500;
}

.press__card:hover,
.press__card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.press__source {
  font-weight: 700;
  color: var(--color-signal-text);
}

.press__closing {
  width: 100%;
  aspect-ratio: 1006 / 469;
  object-fit: cover;
}

/* ---------- Bottom bar: back to top / next project ---------- */

.page-end {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px;
  border-top: 1px solid var(--color-text);
  border-bottom: 1px solid var(--color-text);
  margin-bottom: 20px;
}

.page-end a:last-child {
  justify-self: end;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (max-width: 900px) {
  .press__cards { grid-template-columns: 1fr; }
  .press__card { min-height: 0; font-size: 26px; }
  .press { padding-bottom: 100px; }
}

@media (max-width: 640px) {
  .story__row { grid-template-columns: 1fr; }
  .story__row img { aspect-ratio: 4 / 5; }
  .story__media img, .story__media video { border-radius: 12px; }
  .page-end { grid-template-columns: 1fr 1fr; }
  .page-end > span { display: none; }
}

/* ---------- Chapters ----------
   The page is grouped into 4 chapters. Each opens with a full-width line
   and a large "1 ● Context" style title; the orange dot echoes the one
   next to your name in the header. Space: 120px before a chapter,
   80px between sections inside it (40px padding top + bottom). */

.chapter {
  padding-top: 120px;
  scroll-margin-top: 64px; /* so the sticky bar doesn't cover the start */
}

#context {
  padding-top: 40px;
}

#hardware,
#software {
  scroll-margin-top: 64px;
}

/* Chapter titles are hidden from view (the sticky bar already shows
   where you are) but kept for screen readers. A full-width line still
   marks where each new chapter starts. */
.chapter + .chapter {
  border-top: 1px solid var(--color-text);
  margin-top: 80px;
  padding-top: 40px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Sticky chapter navigation ---------- */

.chapter-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  margin-top: -40px; /* sit right under the cover's bottom line */
}

.chapter-nav {
  --nav-gutter: clamp(20px, 4vw, 52px);
}

/* Four equal columns across the bar. Each chapter name starts exactly at
   the start of its column, and the progress line below fills one column
   per chapter, so it reaches a name the moment that chapter begins. */
.chapter-nav__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 56px; /* same as the date / role row above: 20 + 16 + 20 */
  align-items: center;
  padding-inline: var(--nav-gutter);
}

.chapter-nav__list::-webkit-scrollbar { display: none; }

.chapter-nav a {
  display: flex;
  align-items: center;
  line-height: 16px;
  white-space: nowrap;
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);   /* #6b6b6b: readable (5.3:1) while still quieter than the current chapter */
  transition: color 0.2s ease;
}

.chapter-nav__dot {
  font-size: 8px;
  margin-right: 8px;
  color: #c4c4c4;
  transition: color 0.2s ease, transform 0.2s ease;
}

.chapter-nav__group {
  display: flex;
  align-items: center;
}

/* "Hardware · Software": quiet grey text after Design. Each word is a
   link to its part of the chapter, but they never change look on hover
   or while you read; only Design does (and they darken slightly with it). */
.chapter-nav__parts {
  margin-left: 10px;
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.chapter-nav .chapter-nav__parts a,
.chapter-nav .chapter-nav__parts a:hover,
.chapter-nav .chapter-nav__parts a:focus-visible {
  display: inline;
  color: inherit;
}

.chapter-nav__group:has(> a[aria-current="true"]) .chapter-nav__parts {
  color: #3d3d3d;
}

.chapter-nav a:hover,
.chapter-nav a:focus-visible {
  color: var(--color-text);
}

.chapter-nav a[aria-current="true"] {
  color: var(--color-text);
}

.chapter-nav a[aria-current="true"] .chapter-nav__dot {
  color: var(--color-signal);
  transform: scale(1.3);
}

/* Thin orange line that fills as you read, lined up with the columns. */
.chapter-nav__progress {
  position: absolute;
  left: var(--nav-gutter);
  right: var(--nav-gutter);
  bottom: -1px;
  height: 2px;
  background: var(--color-signal);
  transform-origin: left center;
  transform: scaleX(var(--progress, 0));
}

@media (max-width: 640px) {
  .chapter + .chapter { margin-top: 40px; }
  .chapter-nav a { font-size: 10px; white-space: normal; }
  .chapter-nav__parts { display: none; }
}

/* Project intro: one sentence that opens the case study, larger than body text. */
.case-lead__text {
  max-width: 860px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

/* ---------- Design principles band ----------
   Same dark band as the blueprint strips, but the three principles sit
   side by side across the full width instead of scrolling. */
.strip__grid {
  padding: 20px;
}

.strip--principles .card img {
  border-radius: 16px;
}

.strip--principles .card figcaption {
  color: #ffffff;
}

.strip--principles .card__small-label {
  color: #ffffff;
}

/* Section caption sits on top here, aligned with the image edges. */
.strip--principles .strip__caption {
  padding: 32px 20px 4px;
}

@media (max-width: 640px) {
  .strip--principles .card-row--3 { grid-template-columns: 1fr; row-gap: 30px; }
}

/* ---------- "Learn more" cursor callout ----------
   On computers with a mouse, js/hover-callout.js hides the "Learn more"
   dropdowns and shows the same text in a black bubble that follows the
   cursor over the matching pictures. The text stays in the page
   (visually hidden) so screen readers still read it. */
.research.has-callout .learn-more {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.cursor-callout {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  max-width: 340px;
  padding: 14px 16px 16px;
  background: #000000;
  color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* The corner closest to the cursor is sharp, like a FigJam comment. */
.cursor-callout[data-corner="tl"] { border-top-left-radius: 2px; }
.cursor-callout[data-corner="tr"] { border-top-right-radius: 2px; }
.cursor-callout[data-corner="bl"] { border-bottom-left-radius: 2px; }
.cursor-callout[data-corner="br"] { border-bottom-right-radius: 2px; }

.cursor-callout.is-visible { opacity: 1; }

.cursor-callout__label {
  display: block;
  margin: 0 0 6px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: #ffffff; /* white on dark, like the dark strips */
}

.cursor-callout ul {
  list-style: disc;
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cursor-callout li {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.cursor-callout p {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #ffffff;
}

/* Pictures with data-callout: on computers with a mouse the text moves
   into the callout, so it's hidden here (still read by screen readers). */
.has-callout .callout-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

/* ---------- Focus on hover ----------
   On devices with a mouse, hovering one image + caption block fades the
   others in the same row back, so the eye lands on one thing at a time.
   Only in the Context chapter.
   With nothing hovered, everything shows at full strength. */
@media (hover: hover) and (pointer: fine) {
  #context .card-row .card {
    transition: opacity 0.3s ease;
  }

  #context .card-row:has(.card:hover) .card:not(:hover) {
    opacity: 0.3;
  }
}

/* ---------- Caption titles: one style everywhere ----------
   Every small title that introduces a caption or description uses the
   same hierarchy as the dark-strip captions: 12px uppercase mono, bold,
   then 2px gap, then the 16px Raleway description. Only the colour
   changes: orange on white sections, white in the dark strips, black
   inside the white blueprint cards. */
.card__label,
.card__small-label,
.research__title,
.press__source,
.strip__label,
.note__title,
.bp-col figcaption .small-title {
  display: block;
  margin: 0 0 2px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.card__label,
.card__small-label,
.research__title,
.press__source { color: var(--color-signal-text); }

.strip__label,
.note__title { color: #ffffff; }

.bp-col figcaption .small-title { color: var(--color-text); }

/* The note titles keep their little pointer arrow. */
.note__title { display: flex; }
.note { gap: 0; }

/* ---------- Smaller screens ---------- */

@media (max-width: 1000px) {
  .card-row--4 { grid-template-columns: repeat(2, 1fr); row-gap: 30px; }
  .research { grid-template-columns: 1fr; gap: 20px; }
}

/* Below 780px the annotated diagram gets too cramped, so the callouts
   become a simple list under the mouse. */
@media (max-width: 780px) {
  .features { flex-direction: column; }
  .features__diagram { aspect-ratio: auto; display: flex; flex-direction: column; align-items: center; gap: 24px; }
  .features__mouse { position: relative; width: 60%; max-width: 300px; height: auto; aspect-ratio: 351 / 523; }
  .features__line { display: none; }
  .features__labels { display: flex; flex-direction: column; gap: 12px; width: 100%; }
  .features__labels li {
    position: static;
    width: auto !important;
    white-space: normal;
    text-align: left !important;
    padding-bottom: 12px;
    border-bottom: 1px solid #9a9a9a;
  }
}

@media (max-width: 640px) {
  .card-row--3,
  .card-row--2 { grid-template-columns: 1fr; row-gap: 30px; }
  .card-row--4 { gap: 20px 10px; }
  .case-intro h2 { font-size: 26px; }
  .case-intro p { padding-left: 0; }
  .case-cover__meta { flex-wrap: wrap; }
  .strip__caption { padding-inline: 20px; }
  .rounded-media { border-radius: 12px; }
}

/* Very narrow screens: the mouse picture in "Key new features" must not
   push the page sideways. */
@media (max-width: 400px) { .features__diagram { overflow: hidden; } }
