/* ==========================================================================
   Op Jezelf cards (043, 044, 045) and the app videos, rebuilt from the
   prototypes in the vault (reference/op-jezelf-*.html). Each card is a
   <figure class="media cs-card ojc"> filled by js/op-jezelf.js; the frame,
   tape, header and pause button are shared (css/cards.css). Motion, timing,
   colours, layout and text follow the prototypes; sizes are in cqw of the
   card. Small text is never faded (opacity), so it keeps 4.5:1. Poppins
   (the app's typeface) is used inside the cards only.
   ========================================================================== */

/* Poppins, latin, from Google Fonts (SIL Open Font License) */
@font-face {
  font-family: 'Poppins';
  font-weight: 400;
  src: url('/fonts/Poppins-400.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  font-weight: 500;
  src: url('/fonts/Poppins-500.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  font-weight: 600;
  src: url('/fonts/Poppins-600.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  font-weight: 700;
  src: url('/fonts/Poppins-700.woff2') format('woff2');
  font-display: swap;
}

.ojc {
  --cream: #FFFBE6;
  --leaf: #C1EBA6;
  --forest: #357929;
  --olive: #3D4621;
  --ease-slide: cubic-bezier(.65, 0, .35, 1);
  --bg: var(--cream);
  --fg: var(--olive);
  --ctl-bg: rgba(255, 251, 230, .92);
  --ctl-fg: var(--olive);
}

.ojc-card {
  font-family: 'Poppins', var(--font-body);
  font-weight: 400;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Parts several cards use: header type, title, source line, slide-over
   panels, rolling word
   -------------------------------------------------------------------------- */
.ojc-card .cs-card-hd {
  font-size: max(9px, 2.2cqw);
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: .14em;
}

.ojc-t {
  position: absolute;
  left: 7%;
  top: var(--t-top, 14%);
  z-index: 6;
  font-size: var(--t-size, 6.4cqw);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.ojc-t em {
  font-style: normal;
  color: var(--em, var(--forest));
}

/* The big name line of the type and colour cards */
.ojc-name {
  position: absolute;
  left: 7%;
  right: 5%;
  top: 17%;
  z-index: 2;
  font-size: 8.6cqw;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.ojc-name em {
  font-style: normal;
  color: var(--accent);
}

.ojc-src {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 5%;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: 3cqw;
  row-gap: .6cqw;
  font-size: max(9px, 2.2cqw);
  line-height: 1.5;
}
.ojc-src span {
  white-space: nowrap;
}

/* One full panel per colour or persona; the next slides over the last from
   the right */
.ojc-panel {
  position: absolute;
  inset: 0;
  background: var(--bg);
  color: var(--fg);
  clip-path: inset(0 0 0 100%);
}
.ojc-panel.is-show {
  clip-path: inset(0 0 0 0);
}
.ojc-panel.is-slide {
  transition: clip-path var(--slide, 1.6s) var(--ease-slide);
}

/* A word that changes in place: the old one rises and fades out, the new
   one rises in. All share one grid cell, so they keep the baseline. */
.ojc-roll {
  display: grid;
}
.ojc-roll span {
  grid-area: 1 / 1;
  transition: transform var(--roll-move, 1.5s) cubic-bezier(.6, 0, .25, 1), opacity var(--roll-fade, 1.3s ease-in-out);
}
.ojc-roll .is-in {
  transform: none;
  opacity: 1;
}
.ojc-roll .is-out {
  transform: translateY(var(--roll-up, -95%));
  opacity: 0;
}
.ojc-roll .is-down {
  transform: translateY(60%);
  opacity: 0;
  transition: none;
}

/* --------------------------------------------------------------------------
   Typeface (043)
   -------------------------------------------------------------------------- */
.ojc--type {
  --bg: var(--forest);
  --fg: var(--cream);
}
.ojc--type .ojc-card > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ojc-outline {
  fill: none;
  stroke: var(--leaf);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.ojc-anchor {
  fill: var(--forest);
  stroke: var(--leaf);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}
.ojc-l2 {
  display: flex;
  align-items: baseline;
  gap: .26em;
}
.ojc--type .ojc-roll {
  flex: 1;
  justify-items: start;
  color: var(--leaf);
}

/* --------------------------------------------------------------------------
   Colour (044): a 1.2s slide
   -------------------------------------------------------------------------- */
.ojc--colour {
  --slide: 1.2s;
}
.ojc-chips {
  position: absolute;
  left: 7%;
  top: 42%;
  display: flex;
  gap: 1.6cqw;
}
.ojc-chip {
  width: 5.2cqw;
  height: 5.2cqw;
  background: var(--c);
  box-shadow: 0 0 0 .25cqw rgba(61, 70, 33, .25);
}
/* The marker square slides along the swatches, in sync with the card */
.ojc-marker {
  position: absolute;
  left: 7%;
  top: 42%;
  z-index: 40;
  width: 5.2cqw;
  height: 5.2cqw;
  outline: .35cqw solid var(--m, var(--olive));
  outline-offset: .5cqw;
  transform: translateX(calc(var(--i, 0) * 6.8cqw));
  transition: transform var(--slide) var(--ease-slide), outline-color var(--slide) var(--ease-slide);
  pointer-events: none;
}
.ojc-specs {
  position: absolute;
  left: 7%;
  top: 53%;
  display: grid;
  grid-template-columns: auto auto;
  gap: .6cqw 3cqw;
  margin: 0;
  font-size: max(10px, 2.4cqw);
  font-weight: 500;
}
.ojc-specs dt {
  font-weight: 400;
}
.ojc-specs dd {
  margin: 0;
}
.ojc-hex {
  position: absolute;
  left: 6%;
  bottom: 4%;
  font-size: 18.5cqw;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: .28cqw var(--accent);
}

/* --------------------------------------------------------------------------
   How living alone feels (045): the card is the chart
   -------------------------------------------------------------------------- */
.ojc-bands {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 32%;
  bottom: 12%;
  display: flex;
  flex-direction: column;
  gap: .8cqw;
}
.ojc-band {
  position: relative;
  flex: 0 0 0;
  min-height: 0;
  overflow: hidden;
  border-radius: .6cqw;
  background: var(--c);
  color: var(--fg);
  transition: flex-grow 1.6s var(--ease-slide);
}
.is-on .ojc-band {
  flex-grow: var(--g);
}
.ojc-band-in {
  position: absolute;
  left: 3.5cqw;
  right: 3.5cqw;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 1cqw;
  opacity: 0;
  transform: translateY(40%);
  transition: transform 1.2s cubic-bezier(.3, 0, .2, 1), opacity 1s;
  transition-delay: calc(var(--d) + 1s);
}
.is-on .ojc-band-in {
  transform: none;
  opacity: 1;
}
.ojc-band b {
  font-size: var(--fs);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
}
.ojc-band i {
  font-style: normal;
  font-size: max(10px, 2.4cqw);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   What teens knew, and what they didn't (045)
   -------------------------------------------------------------------------- */
.ojc-qs {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 30%;
  display: flex;
  flex-direction: column;
}
.ojc-grp {
  margin-bottom: 1.6cqw;
  font-size: max(9px, 2.2cqw);
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.ojc-grp.is-gap {
  margin-top: 3.2cqw;
}
.ojc-q {
  display: grid;
  grid-template-columns: 19cqw 1fr;
  column-gap: 3cqw;
  align-items: end;
  margin-bottom: 2.6cqw;
}
.ojc-num {
  font-size: 8.6cqw;
  font-weight: 600;
  line-height: .82;
  letter-spacing: -.04em;
  color: var(--forest);
  font-variant-numeric: tabular-nums;
  clip-path: inset(0 0 100% 0);
  transform: translateY(20%);
  transition: clip-path 1.2s var(--ease-slide), transform 1.2s var(--ease-slide);
  transition-delay: var(--d);
}
.ojc-num.is-zero {
  color: var(--olive);
}
.ojc-num small {
  margin-left: .04em;
  font-size: .42em;
}
.ojc-txt {
  font-size: max(10.5px, 2.8cqw);
  font-weight: 500;
  line-height: 1.3;
  opacity: 0;
  transition: opacity 1s;
  transition-delay: calc(var(--d) + .4s);
}
.ojc-meter {
  grid-column: 1 / -1;
  height: .8cqw;
  margin-top: 1.3cqw;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(61, 70, 33, .12);
}
.ojc-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--forest);
  transition: width 1.6s var(--ease-slide);
  transition-delay: calc(var(--d) + .6s);
}
.is-on .ojc-num {
  clip-path: inset(0 0 0 0);
  transform: none;
}
.is-on .ojc-txt {
  opacity: 1;
}
.is-on .ojc-meter i {
  width: var(--w);
}
/* A phone-sized card (the prototype's 420px screen) */
@container (max-width: 364px) {
  .ojc-qs { top: 29%; }
  .ojc-q { margin-bottom: 1.4cqw; }
  .ojc-grp.is-gap { margin-top: 1.8cqw; }
  .ojc-txt { font-size: 10px; }
}

/* --------------------------------------------------------------------------
   The characters (045): all fourteen in rows of 5, 4 and 5. Each face
   rises out of its own slot, once, then they take turns saying hi
   -------------------------------------------------------------------------- */
.ojc--characters {
  --bg: var(--forest);
  --fg: var(--cream);
  --em: var(--leaf);
}
.ojc-cast {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 39%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.4cqw;
}
.ojc-line {
  display: flex;
  gap: 3cqw;
}
.ojc-slot {
  width: 13.6cqw;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #F7F7F7;
}
.ojc-face {
  width: 100%;
  height: 100%;
  transform: translateY(105%);
  transition: transform 1.3s cubic-bezier(.6, 0, .25, 1);
  transition-delay: var(--d);
}
.ojc-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 100%;
  transform: scale(1.03);
  transition: transform 1s cubic-bezier(.3, 1.4, .5, 1);
}
.is-on .ojc-face {
  transform: none;
}
.ojc-face.is-hi img {
  transform: translateY(-6%) rotate(-4deg) scale(1.03);
}

/* --------------------------------------------------------------------------
   The weekly shop (045): food drops behind the front of the bag
   -------------------------------------------------------------------------- */
.ojc--shop {
  --t-top: 13.5%;
  --t-size: 5.8cqw;
}
.ojc-shadow {
  position: absolute;
  right: 7%;
  bottom: 7%;
  z-index: 1;
  width: 44cqw;
  height: 3cqw;
  border-radius: 50%;
  background: rgba(61, 70, 33, .12);
}
.ojc-bag {
  position: absolute;
  right: 9.5%;
  bottom: 8%;
  z-index: 4;
  width: 39cqw;
  transform-origin: 50% 100%;
}
.ojc-bag.is-thud {
  animation: ojcThud .55s cubic-bezier(.3, 1.6, .5, 1);
}
@keyframes ojcThud {
  30%  { transform: scale(1.035, .965); }
  100% { transform: scale(1); }
}
.ojc-drop {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  transform-origin: 50% 50%;
  will-change: transform;
}
.ojc--shop .ojc-src {
  right: auto;
  bottom: 6%;
  display: block;
  max-width: 40%;
}

/* --------------------------------------------------------------------------
   The personas (045): one panel each, the pause button and dots on the card
   -------------------------------------------------------------------------- */
.ojc-k {
  position: absolute;
  left: 7%;
  top: 14%;
  font-size: max(10px, 2.4cqw);
  line-height: 1.5;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.ojc-nm {
  position: absolute;
  left: 7%;
  top: 19%;
  z-index: 2;
  width: 60%;
  font-size: 6.6cqw;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.ojc-tr {
  position: absolute;
  left: 7%;
  top: 43%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1.6cqw;
  width: 43%;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: max(11px, 2.9cqw);
  font-weight: 500;
  line-height: 1.3;
}
.ojc-tr li {
  padding-top: 1.4cqw;
  border-top: .2cqw solid color-mix(in srgb, currentColor 25%, transparent);
}
/* A phone-sized card: the traits wrap more, so they sit a little tighter
   to stay clear of the source line */
@container (max-width: 364px) {
  .ojc-tr { top: 41%; gap: 1cqw; line-height: 1.25; }
  .ojc-tr li { padding-top: 1cqw; }
}
.ojc-pic {
  position: absolute;
  right: -3%;
  bottom: 0;
  z-index: 1;
  width: auto;
  height: 60%;
}
.ojc--personas .ojc-src {
  right: auto;
  bottom: 10%;
  display: block;
  font-size: max(9px, 2.1cqw);
  white-space: nowrap;
}
/* The dots: each is a 24px target (WCAG 2.5.8) with the small square drawn
   in its middle, so the squares still line up with the text at 7% */
.ojc-dots {
  --dot: 1.6cqw;
  --hit: max(24px, 3cqw);
  position: absolute;
  left: calc(7% - (var(--hit) - var(--dot)) / 2);
  bottom: calc(6% - (24px - var(--dot)) / 2);
  display: flex;
}
.ojc-dot {
  position: relative;
  width: var(--hit);
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.ojc-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--dot);
  height: var(--dot);
  border: .3cqw solid currentColor;
  opacity: .5;
  transform: translate(-50%, -50%);
}
.ojc-dot.is-on::before {
  background: currentColor;
  opacity: 1;
}
.ojc-dot:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

/* --------------------------------------------------------------------------
   Your first flat (045): messy underneath, each room's clean version slides
   over it while the checklist ticks it off
   -------------------------------------------------------------------------- */
.ojc--flat {
  --bg: var(--leaf);
  --t-top: 13%;
  --t-size: 5.4cqw;
}
.ojc-plan {
  position: absolute;
  left: 50%;
  top: 27%;
  width: 56cqw;
  aspect-ratio: 1;
  transform: translateX(-50%);
}
.ojc-plan img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.ojc-plan .ojc-room {
  clip-path: inset(var(--t) var(--r) var(--b) var(--x2));
  transition: clip-path 1s var(--ease-slide);
}
.ojc-plan .ojc-room.is-on {
  clip-path: inset(var(--t) var(--r) var(--b) var(--l));
}
.ojc-list {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 5.5%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4cqw;
  margin: 0;
  padding: 0;
  font-size: max(10px, 2.4cqw);
  line-height: 1.5;
  font-weight: 500;
}
.ojc-list li {
  display: flex;
  align-items: center;
  gap: 1.4cqw;
  list-style: none;
  white-space: nowrap;
}
.ojc-list i {
  display: grid;
  place-items: center;
  width: 2.4cqw;
  height: 2.4cqw;
  border: .3cqw solid var(--olive);
  transition: background-color .6s, border-color .6s;
}
.ojc-list i::after {
  content: '';
  width: 1.2cqw;
  height: .6cqw;
  border-left: .3cqw solid var(--cream);
  border-bottom: .3cqw solid var(--cream);
  transform: translateY(-.2cqw) rotate(-45deg) scale(0);
  transition: transform .5s cubic-bezier(.3, 1.6, .5, 1) .2s;
}
.ojc-list li.is-done i {
  background: var(--forest);
  border-color: var(--forest);
}
.ojc-list li.is-done i::after {
  transform: translateY(-.2cqw) rotate(-45deg) scale(1);
}
.ojc--flat .ojc-roll {
  --roll-move: 1s;
  --roll-fade: .8s ease;
  --roll-up: -60%;
  position: absolute;
  right: 7%;
  top: 14.5%;
  font-size: max(10px, 2.4cqw);
  line-height: 1.5;
  font-weight: 600;
  text-align: right;
}

/* --------------------------------------------------------------------------
   What testing changed: what we saw, what we changed. Static. 16:9, 4:5 on
   phones.
   -------------------------------------------------------------------------- */
.ojc--testing {
  --bg: var(--forest);
  --fg: var(--cream);
  --em: var(--leaf);
  aspect-ratio: 16 / 9;
}
.ojc--testing .cs-card-hd {
  top: 5.5%;
  left: 5%;
  right: 5%;
  font-size: max(9px, 1.3cqw);
}
.ojc--testing .ojc-t {
  left: 5%;
  top: 14%;
  font-size: 3.6cqw;
}
.ojc-cols,
.ojc-row {
  display: grid;
  grid-template-columns: 1fr 6cqw 1fr;
  column-gap: 2cqw;
}
.ojc-cols {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 31%;
  font-size: max(9px, 1.25cqw);
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.ojc-cols span:last-child {
  grid-column: 3;
}
.ojc-rows {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 37%;
  display: flex;
  flex-direction: column;
}
.ojc-row {
  align-items: center;
  padding: 2.1cqw 0;
  border-top: .12cqw solid rgba(255, 251, 230, .25);
}
.ojc-saw,
.ojc-did {
  font-size: max(11px, 1.9cqw);
  line-height: 1.3;
}
.ojc-saw {
  font-weight: 500;
}
.ojc-did {
  font-weight: 600;
}
.ojc-arrow {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.ojc-arrow path {
  fill: none;
  stroke: var(--leaf);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.ojc--testing .ojc-src {
  left: 5%;
  right: 5%;
  font-size: max(9px, 1.2cqw);
}
@media (max-width: 759.98px) {
  .ojc--testing {
    aspect-ratio: 4 / 5;
  }
  .ojc--testing .cs-card-hd,
  .ojc--testing .ojc-src {
    font-size: max(9px, 2.4cqw);
  }
  .ojc--testing .ojc-t {
    font-size: 6.4cqw;
  }
  .ojc-cols,
  .ojc-row {
    grid-template-columns: 1fr 8cqw 1fr;
  }
  .ojc-cols {
    top: 27%;
    font-size: max(9px, 2.4cqw);
  }
  .ojc-rows {
    top: 32%;
  }
  .ojc-row {
    padding: 3.6cqw 0;
  }
  .ojc-saw,
  .ojc-did {
    font-size: max(11px, 3.4cqw);
  }
}

/* --------------------------------------------------------------------------
   Pause button colours, per card (the button itself: css/cards.css)
   -------------------------------------------------------------------------- */
.ojc--type,
.ojc--characters {
  --ctl-bg: rgba(255, 251, 230, .92);
  --ctl-fg: var(--forest);
}
.ojc--colour {
  --ctl-bg: rgba(23, 32, 13, .85);
  --ctl-fg: var(--cream);
}
.ojc--feelings,
.ojc--quiz,
.ojc--shop,
.ojc--flat {
  --ctl-bg: var(--olive);
  --ctl-fg: var(--cream);
}

/* --------------------------------------------------------------------------
   The app videos (05): three phones side by side, one on phones. Each has
   its own play/pause button over it; nothing plays on its own.
   -------------------------------------------------------------------------- */
.oj-vids {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6%;
  background: #131313;
}
/* The phones (059, 572 x 1164 with the frame baked in) stand 94% of the
   figure's height, as reference/op-jezelf-case-study-mockup.html */
.oj-vid {
  position: relative;
  height: 94%;
  max-width: 28%;
  aspect-ratio: 572 / 1164;
}
.oj-vid video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.oj-vid-btn {
  position: absolute;
  inset: 0;
  z-index: 4; /* over the gloss */
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.oj-vid-btn:focus-visible {
  outline-offset: -3px;
}
/* Play (a triangle) on a grey disc; while playing it hides, and shows
   Pause (two bars) on hover or focus */
.oj-vid-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: rgba(80, 80, 80, .85);
  transition: opacity .2s;
}
.oj-vid-icon::after {
  content: '';
  position: absolute;
  top: 17px;
  left: 22px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 16px solid #FFFFFF;
}
.is-playing .oj-vid-icon {
  opacity: 0;
}
.is-playing .oj-vid-btn:hover .oj-vid-icon,
.is-playing .oj-vid-btn:focus-visible .oj-vid-icon {
  opacity: 1;
}
.is-playing .oj-vid-icon::after {
  top: 18px;
  left: 19px;
  width: 6px;
  height: 20px;
  border: 0;
  border-left: 6px solid #FFFFFF;
  border-right: 6px solid #FFFFFF;
  box-sizing: content-box;
}
@media (max-width: 759.98px) {
  .oj-vid {
    width: auto;
    height: 94%;
    max-width: none;
  }
  .oj-vid:not(:nth-child(2)) {
    display: none;
  }
}

