/* ==========================================================================
   My Mind Check case study (hidden preview /work/my-mind-check/).
   Every rule is scoped to .mm / mm-*. The hero and video surfaces are always
   black (the character animation is mastered on black); everything else
   follows the site theme.
   ========================================================================== */
.mm {
  --mm-cols: repeat(12, minmax(0, 1fr));
  --mm-gap: clamp(1.25rem, 3vw, 3rem);
}
.mm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mm svg { display: block; }

.js .mm [data-mm-in] { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease-out), transform .8s var(--ease-out); }
.js .mm [data-mm-in].is-in { opacity: 1; transform: none; }

/* ---------- Hero ----------
   The composition (1920 × 1066) leaves black space top left for the title.
   Desktop: the stage is as wide as the page allows but never taller than the
   screen; if height-limited it sits to the right and the black merges into the
   page. The title scales with the stage so it always clears the characters. */
.mm-hero { position: relative; background: #000; color: #F4F3EF; container-type: inline-size; }
.mm-hero__inner {
  --mm-ar: 1.8011;
  --mm-stage: min(100cqw, (100svh - 6.5rem) * var(--mm-ar));
  position: relative;
  height: calc(var(--mm-stage) / var(--mm-ar));
  min-height: 22rem;
}
.mm-hero__stage { position: absolute; top: 0; right: 0; width: var(--mm-stage); aspect-ratio: 1920 / 1066; overflow: hidden; background: #000; }
.mm-hero__still, .mm-hero__video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; }
.mm-hero__still { object-fit: cover; }
.mm-hero__video { object-fit: cover; }
/* Without JS, with reduced motion, or if the video can't play: the static artwork. */
.no-js .mm-hero__video, .mm-hero__stage.is-still .mm-hero__video { visibility: hidden; }

/* Keyboard-only pause control: invisible until focused (the hero shows no controls). */
.mm-hero__pause { position: absolute; right: var(--gutter); bottom: 1rem; padding: .6rem .9rem; border: 1px solid rgba(244, 243, 239, .5); border-radius: 999px; background: rgba(0, 0, 0, .6); color: #F4F3EF; font: 500 .8125rem/1 var(--font-body); cursor: pointer; opacity: 0; pointer-events: none; }
.mm-hero__pause:focus-visible { opacity: 1; pointer-events: auto; outline: 2px solid var(--orange); outline-offset: 2px; }
.mm-hero__stage.is-still .mm-hero__pause { display: none; }
.mm-hero__stage.is-still.is-held .mm-hero__pause { display: block; }

.mm-hero__wrap { position: relative; z-index: 1; height: 100%; pointer-events: none; }
.mm-hero__title {
  padding-top: calc(var(--mm-stage) * .045);
  font: 700 min(calc(var(--mm-stage) * .079), 10rem)/.94 var(--font-head);
  letter-spacing: .01em;
  color: #F4F3EF;
}
.mm-hero__title span { display: block; width: fit-content; }

/* ---------- Opening ---------- */
.mm-open { display: grid; grid-template-columns: var(--mm-cols); column-gap: var(--mm-gap); row-gap: clamp(2rem, 1.5rem + 2vw, 3.5rem); padding-top: clamp(2.5rem, 1.5rem + 3vw, 5rem); }
.mm-open__head { grid-column: 1 / span 6; }
.mm-open__top { margin: 0 0 clamp(1rem, .5rem + 1.5vw, 2rem); }
.mm-line { max-width: 15em; font: 400 clamp(1.625rem, 1.1rem + 1.8vw, 3rem)/1.15 var(--font-head); letter-spacing: .005em; color: var(--fg); text-wrap: balance; }
.mm-dash { display: block; width: 2.75rem; height: 3px; margin-top: clamp(1.5rem, 1rem + 1.5vw, 2.5rem); background: var(--orange); }
.mm-open__body { grid-column: 8 / span 5; color: var(--fg-2); font-size: clamp(.9375rem, .9rem + .2vw, 1.0625rem); line-height: 1.6; }
.mm-open__body p + p { margin-top: 1em; }
.mm-open__body p:first-child { color: var(--fg); }
.mm-facts { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 1.5rem var(--mm-gap); margin: 0; padding-top: 1.25rem; border-top: 1px solid var(--line); }
[data-theme="dark"] .mm-facts, :root:not([data-theme]) .mm-facts { border-top-color: #2a2a2a; }
.mm-facts dt { font: 500 .75rem/1.4 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.mm-facts dd { margin: .45rem 0 0; font-size: .9375rem; line-height: 1.5; color: var(--fg); }

/* ---------- Sections ---------- */
.mm-sec { padding-top: clamp(5rem, 3rem + 6vw, 10rem); }
.mm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: clamp(1.25rem, 1rem + 1vw, 2rem); padding-top: 1rem; border-top: 1px solid var(--line); }
[data-theme="dark"] .mm-head, :root:not([data-theme]) .mm-head { border-top-color: #2a2a2a; }
.mm-head .label { order: 2; }
.mm-h2 { font: 700 clamp(1.75rem, 1.2rem + 2vw, 3rem)/1.05 var(--font-head); letter-spacing: .01em; }

/* ---------- Players ---------- */
.mm-player { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.mm-player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.mm-player:fullscreen { aspect-ratio: auto; width: 100vw; height: 100vh; }
.mm-player__big { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 1rem; padding: clamp(1rem, 3vw, 2.5rem); border: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 45%); color: #F4F3EF; text-align: left; cursor: pointer; }
.mm-player__ring { display: grid; place-items: center; flex: none; width: clamp(3.5rem, 2.75rem + 2.5vw, 5.5rem); aspect-ratio: 1; border: 1.5px solid rgba(244, 243, 239, .85); border-radius: 999px; background: rgba(0, 0, 0, .3); transition: background-color .2s ease, border-color .2s ease, transform .3s var(--ease-out); }
.mm-player__ring svg { width: 34%; height: 34%; margin-left: 6%; }
.mm-player__big:hover .mm-player__ring, .mm-player__big:focus-visible .mm-player__ring { background: var(--orange); border-color: var(--orange); transform: scale(1.04); }
.mm-player__big:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.mm-player__now { padding-bottom: .35rem; font: 700 clamp(1.0625rem, .95rem + .6vw, 1.5rem)/1.1 var(--font-head); letter-spacing: .01em; }
.mm-player__len { margin-left: .5rem; font: 500 .8125rem/1 var(--font-body); color: rgba(244, 243, 239, .7); font-variant-numeric: tabular-nums; }
.mm-player[data-state="playing"] .mm-player__big, .mm-player[data-state="paused"] .mm-player__big { display: none; }
.mm-player__bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: .5rem; padding: 2.5rem clamp(.5rem, 1.5vw, 1.25rem) clamp(.4rem, 1vw, .9rem); background: linear-gradient(0deg, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, 0) 100%); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s; }
.mm-player[data-state="paused"] .mm-player__bar, .mm-player.is-awake .mm-player__bar, .mm-player:focus-within:not([data-state="idle"]) .mm-player__bar { opacity: 1; visibility: visible; transition: opacity .2s ease; }
.mm-player[data-state="idle"] .mm-player__bar { display: none; }
.mm-ctl { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: none; color: #F4F3EF; cursor: pointer; transition: color .15s ease; }
.mm-ctl svg { width: 20px; height: 20px; }
.mm-ctl:hover { color: var(--orange); }
.mm-ctl:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.mm-ctl .i-pause, .mm-ctl .i-mute { display: none; }
.mm-player[data-state="playing"] [data-toggle] .i-play { display: none; }
.mm-player[data-state="playing"] [data-toggle] .i-pause { display: block; }
.mm-player.is-muted [data-mute] .i-vol { display: none; }
.mm-player.is-muted [data-mute] .i-mute { display: block; }
.mm-player__time { flex: none; min-width: 2.6em; font: 500 .8125rem/1 var(--font-body); font-variant-numeric: tabular-nums; color: rgba(244, 243, 239, .85); text-align: center; }
.mm-player__seek { --p: 0%; flex: 1; min-width: 3rem; height: 44px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.mm-player__seek::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--orange) var(--p), rgba(244, 243, 239, .3) var(--p)); }
.mm-player__seek::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--orange) var(--p), rgba(244, 243, 239, .3) var(--p)); }
.mm-player__seek::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; margin-top: -5px; border: 0; border-radius: 999px; background: #F4F3EF; }
.mm-player__seek::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 999px; background: #F4F3EF; }
.mm-player__seek:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ---------- Character animation ----------
   The 4 : 1 strip plays once as it comes into view and holds on the finished
   characters (its last frame doesn't join its first, so it isn't looped). */
.mm-strip { margin: 0; }
.mm-strip__frame { position: relative; aspect-ratio: 4 / 1; overflow: hidden; background: #f5f0fb; }
.mm-strip video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mm-strip__btn { position: absolute; right: .75rem; bottom: .75rem; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #F4F3EF; cursor: pointer; opacity: 0; transition: opacity .25s ease, background-color .2s ease; }
.mm-strip__btn svg { width: 18px; height: 18px; }
.mm-strip__frame.is-done .mm-strip__btn, .mm-strip__btn:focus-visible { opacity: 1; }
.mm-strip__btn:hover { background: var(--orange); }
.mm-strip__btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ---------- Laptop mockups: one shared height, each sized by its shape ---------- */
.mm-pair { display: flex; align-items: flex-start; gap: clamp(.75rem, 1.6vw, 1.5rem); margin-top: clamp(3rem, 2rem + 3vw, 5.5rem); }
.mm-fig { flex: var(--ar, 1) 1 0; min-width: 0; margin: 0; }
.mm-fig img { display: block; width: 100%; height: auto; }

/* ---------- Notes ---------- */
.mm-end { padding-top: clamp(4rem, 2.5rem + 4vw, 7rem); padding-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
.mm-legal { max-width: 46rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .75rem; line-height: 1.55; letter-spacing: .01em; color: var(--fg-3); }
[data-theme="dark"] .mm-legal, :root:not([data-theme]) .mm-legal { border-top-color: #2a2a2a; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .mm-open__head { grid-column: 1 / -1; }
  .mm-open__body { grid-column: 1 / span 10; }
  .mm-facts { grid-template-columns: 1fr 1fr; }
  .mm-facts > div:last-child { grid-column: 1 / -1; }
}

/* ---------- Phone ----------
   Title above the artwork. The artwork is cropped to the characters
   (x 380–1920, y 225–1066 of the 1920 × 1066 frame): the empty black above
   and the far-left blob go, all four characters stay whole and larger. */
@media (max-width: 760px) {
  .mm-hero__inner { display: flex; flex-direction: column-reverse; height: auto; min-height: 0; }
  .mm-hero__wrap { height: auto; padding-top: 1.75rem; }
  .mm-hero__title { padding-top: 0; font-size: clamp(3.25rem, 17vw, 5.5rem); line-height: .95; }
  .mm-hero__stage { position: relative; width: 100%; aspect-ratio: 1540 / 841; margin-top: 1.25rem; }
  .mm-hero__still, .mm-hero__video { inset: auto; top: -26.754%; left: -24.675%; width: 124.675%; max-width: none; height: auto; aspect-ratio: 1920 / 1066; }
  .mm-hero__pause { right: .5rem; bottom: .5rem; }

  .mm-open { padding-top: 1.75rem; row-gap: 1.75rem; }
  .mm-line { font-size: clamp(1.5rem, 6.6vw, 1.875rem); }
  .mm-open__body { grid-column: 1 / -1; }
  .mm-facts { grid-template-columns: 1fr; gap: 1.25rem; }

  .mm-sec { padding-top: 4.5rem; }
  .mm-film, .mm-strip-wrap { padding-inline: 0; }
  .mm-player__time[data-dur] { display: none; }
  .mm-strip__frame { aspect-ratio: 4 / 1; }
  .mm-strip__btn { width: 36px; height: 36px; right: .4rem; bottom: .4rem; }
  .mm-pair { flex-direction: column; gap: 1rem; }
  .mm-pair .mm-fig { flex: none; width: 100%; }
  .mm-pair .mm-fig:first-child { width: 72%; }
}

@media (prefers-reduced-motion: reduce) {
  .js .mm [data-mm-in] { opacity: 1; transform: none; transition: none; }
  .mm-player__ring { transition: none; }
}
