/* ==========================================================================
   Brand identity case study: Effectus Media, frame by frame from its brand book.
   The page sets in the site's own type, because the site is this identity.
   ========================================================================== */
.em { --vi: #5600e5; --pu: #8e2de2; --mi: #00001a; --la: #dadafe; --paper: #f5f5ff; timeline-scope: --e2, --e3, --e4, --e5, --e6, --e7, --e8, --e9, --e10, --e11, --e12; }
.em h2 { margin: 0; }
.em-tag { margin: 0; font: 400 clamp(14px, 1.15vw, 18px)/1 var(--f-text); letter-spacing: 0.16em; text-transform: uppercase; color: #fff; }
.em-tag--d { color: var(--mi); }
/* a tag that sits in the hairlines' box, as the book sets it */
.em-tagged { position: absolute; left: 7%; top: 13%; translate: 0 -50%; white-space: nowrap; z-index: 1; }

/* ---------- Each section pins, and the next slides over it ---------- */
/* 250vh: a screen to rise, half a screen to hold, and the next screen sliding over it */
.em-step { position: relative; height: 250vh; }
.em-step + .em-step, .em-step + .em-tunnel, .em-tunnel + .em-step { margin-top: -100vh; }
.em-step__in { position: sticky; top: 0; height: 100vh; min-height: 620px; overflow: hidden; }
.em-step__in::after { content: ""; position: absolute; inset: 0; z-index: 5; background: #00001a; opacity: 0; pointer-events: none; }
.em-mark { position: absolute; left: 0; top: 0; width: 1px; height: 100vh; visibility: hidden; }
.em-tunnel { z-index: 1; }
.em-end { height: 150vh; z-index: 2; }

/* ---------- The hairlines ---------- */
[data-em-grid] { position: absolute; visibility: hidden; pointer-events: none; }
.em-grid { position: fixed; inset: 0; z-index: 60; pointer-events: none; color: rgba(255, 255, 255, 0.5); transition: color 0.4s, opacity 0.5s, translate 0.9s var(--ease-out); will-change: translate; }
.em-grid.is-dark { color: rgba(86, 0, 229, 0.42); }
.em-grid.is-soft { color: rgba(255, 255, 255, 0.34); translate: none; }
.em-grid i, .em-grid b { position: absolute; will-change: transform; }
/* they follow the sheet up, then click into place: every line and crosshair lands on one timing, so the crosshairs never leave their crossings */
.em-grid.is-snap i, .em-grid.is-snap b { transition: transform 0.5s cubic-bezier(0.2, 1.5, 0.36, 1); }
.em-grid i { background: currentColor; }
.em-grid .v { left: 0; top: 0; width: 1px; height: 100%; }
.em-grid .h { left: 0; top: 0; width: 100%; height: 1px; }
.em-grid b { left: -10px; top: -10px; width: 21px; height: 21px; color: #fff; background: linear-gradient(currentColor, currentColor) 50% 50% / 1px 100% no-repeat, linear-gradient(currentColor, currentColor) 50% 50% / 100% 1px no-repeat; }
.em-grid.is-dark b { color: var(--mi); }
.em-grid.is-soft b { left: -8px; top: -8px; width: 17px; height: 17px; color: inherit; }

/* ---------- Cover ---------- */
.em-cover .em-step__in { display: grid; justify-items: center; color: #fff; background: #5a1ae6 url("../media/portfolio/Branding/Effectus%20Media/effectus-media-gradient.webp") 50% 50% / cover no-repeat; }
.em-cover .st-meta { position: absolute; left: 0; right: 0; top: calc(var(--nav-h) + 28px); }
.em-cover__logo { position: absolute; left: 50%; top: 46.3%; width: 37.5vw; height: auto; translate: -50% -50%; fill: #fff; }
.em-cover__t { position: absolute; left: 50%; top: 64.7%; translate: -50% -50%; white-space: nowrap; }

/* ---------- Brand introduction ---------- */
.em-intro .em-step__in { display: flex; background: linear-gradient(180deg, #8c9eff 0%, #4a3cf0 26%, #2d16d8 56%, #12067f 82%, #0a0350 100%); color: #fff; }
.em-intro__copy { flex: 1 1 0; min-width: 0; display: grid; align-content: start; gap: clamp(14px, 2.4vh, 24px); padding: 26vh 4vw 0 7%; }
.em-intro__big { margin: 0; font: 500 clamp(1.25rem, 0.7rem + 1.25vw, 2rem)/1.22 var(--f-text); letter-spacing: -0.01em; }
.em-intro__small { margin: clamp(10px, 2vh, 20px) 0 0; font-size: clamp(14px, 1.05vw, 16px); line-height: 1.45; color: rgba(255, 255, 255, 0.72); }
.em-intro__fig { flex: none; height: 100%; aspect-ratio: 1; margin: 0; }
.em-intro__fig img { display: block; width: 100%; height: 100%; }

/* ---------- What we believe ---------- */
.em-believe .em-step__in { display: grid; place-items: center; background: #fff; }
.em-believe__fig { position: relative; width: min(88vw, calc(84vh * 1694 / 906)); margin: 0; color: #fff; }
.em-believe__fig img { display: block; width: 100%; height: auto; }
.em-believe__fig::after { content: ""; position: absolute; inset: 56% 0 0; background: linear-gradient(180deg, transparent, rgba(20, 10, 60, 0.62)); pointer-events: none; }
.em-believe__fig .em-tag { position: absolute; left: 0; right: 0; top: 13.5%; text-align: center; }
.em-believe__fig p { position: absolute; z-index: 1; left: 0; right: 0; bottom: 8%; margin: 0; text-align: center; font: 400 clamp(1.05rem, 0.6rem + 1vw, 1.6rem)/1.28 var(--f-display); }

/* ---------- Vision and mission ---------- */
.em-vm .em-step__in { display: flex; }
.em-vm__bg { flex: 1 1 0; min-width: 0; width: 50%; height: 100%; object-fit: cover; }
.em-vm__cards { position: absolute; left: 4.3vw; right: 4.3vw; top: 10vh; bottom: 9.5vh; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8.4vw; }
.em-vm__card { display: grid; grid-template-rows: auto 1fr; justify-items: center; padding: clamp(24px, 4vh, 40px) clamp(20px, 3vw, 48px); background: #fff; color: var(--mi); text-align: center; }
.em-vm__card .em-tag { color: var(--mi); }
.em-vm__card p { align-self: center; margin: 0; max-width: 17em; font: 300 clamp(1.4rem, 0.9rem + 1.3vw, 2.2rem)/1.2 var(--f-display); }

/* ---------- Half the story ---------- */
.em-half .em-step__in { display: flex; align-items: stretch; justify-content: center; padding-block: 8vh 7.5vh; background: var(--paper); color: var(--mi); }
.em-half__l { flex: 1 1 0; min-width: 0; display: grid; grid-template-rows: auto 1fr; align-items: end; gap: 24px; padding: 2.4vh 2.4vw 0 2.2vw; font-size: clamp(14px, 1.1vw, 16px); line-height: 1.45; color: #4b4b63; }
.em-half__l h2 { font: 300 clamp(1.7rem, 1rem + 1.7vw, 2.8rem)/1.08 var(--f-display); letter-spacing: -0.02em; color: var(--mi); }
.em-half__l p { margin: 0; }
.em-half__fig { position: relative; flex: none; height: 100%; aspect-ratio: 610 / 917; margin: 0; overflow: hidden; }
.em-half__fig img { display: block; width: 100%; height: 100%; }
.em-half__r { flex: 1 1 0; min-width: 0; align-self: center; margin: 0; padding: 0 2.2vw 0 2.4vw; font: 500 clamp(1.15rem, 0.8rem + 0.9vw, 1.7rem)/1.3 var(--f-text); text-align: right; }
.em-lens canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- AI first ---------- */
.em-ai .em-step__in { background: #2c33c8; color: #fff; }
.em-ai .st-cover img { object-position: 62% 50%; }
.em-ai__t, .em-ai__a, .em-ai__b { position: absolute; z-index: 1; margin: 0; color: #fff; pointer-events: none; }
.em-ai__t { right: 3.8vw; top: 6vh; font: 300 clamp(1.6rem, 1.1rem + 1.5vw, 2.8rem)/1 var(--f-display) !important; }
.em-ai__a { left: 2.2vw; top: 17vh; width: 28vw; font-size: clamp(14px, 1.1vw, 16.5px); line-height: 1.45; color: rgba(255, 255, 255, 0.82); }
.em-ai__b { left: 2.2vw; bottom: 13vh; width: 29vw; font: 500 clamp(1.2rem, 0.8rem + 1.1vw, 1.9rem)/1.28 var(--f-text); }

/* ---------- What we make ---------- */
.em-make .em-step__in { display: grid; place-items: center; background: #fff; }
.em-make__rows { position: relative; display: grid; gap: 10px; width: min(92vw, calc(88vh * 2.05)); }
.em-make .st-row { gap: 10px; }
.em-make figure { position: relative; color: #fff; }
.em-make figcaption { position: absolute; left: 3%; top: 8%; max-width: 8em; font: 500 clamp(1.05rem, 0.8rem + 0.7vw, 1.6rem)/1.1 var(--f-text); }
.em-make .is-ink figcaption { color: var(--mi); }
.em-make .is-low figcaption { top: auto; bottom: 8%; }

/* ---------- Logo meaning, clear space ---------- */
.em-mean .em-step__in, .em-clear .em-step__in { color: #fff; background: radial-gradient(60% 80% at 0% 34%, #a04dff, transparent 66%), radial-gradient(56% 72% at 100% 100%, #a04dff, transparent 62%), #2a0f9c; }
.em-mean h2#em-mean-title { position: absolute; left: 0; right: 0; top: 24.5%; text-align: center; font: 500 clamp(1.4rem, 0.9rem + 1.3vw, 2.2rem)/1.1 var(--f-text); }
.em-mean__box { position: absolute; left: 50%; top: 53%; width: min(43.5vw, 70vh); height: auto; translate: -50% -50%; fill: #fff; }
.em-mean__lines path { fill: none; stroke: rgba(255, 255, 255, 0.42); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.em-mean__copy { position: absolute; left: 50%; bottom: 7.5%; width: min(64vw, 900px); margin: 0; translate: -50% 0; text-align: center; font-size: clamp(14px, 1.15vw, 17px); line-height: 1.42; color: rgba(255, 255, 255, 0.78); }
.em-clear .em-step__in { background: radial-gradient(50% 70% at 0% 10%, #8a3dff, transparent 62%), radial-gradient(64% 80% at 100% 74%, #b06cff, transparent 62%), #1f0b86; }
.em-clear__copy { position: absolute; left: 7%; right: 8%; top: 23%; margin: 0; font-size: clamp(14px, 1.15vw, 17px); line-height: 1.42; color: rgba(255, 255, 255, 0.82); }
.em-clear__box { position: absolute; left: 50%; top: 66%; width: min(52vw, 86vh); height: auto; translate: -50% -50%; fill: #fff; overflow: visible; }
.em-clear__fill rect { fill: rgba(255, 255, 255, 0.1); }
.em-clear__l { fill: none; stroke: rgba(255, 255, 255, 0.46); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.em-clear__x text { font: 400 26px/1 var(--f-text); text-anchor: middle; dominant-baseline: central; fill: #fff; }

/* ---------- The colours ---------- */
.em-cols__row { display: flex; height: 100%; }
.em-cols__row button { flex: 1 1 0; min-width: 0; display: grid; grid-template-rows: 50% auto 1fr; background: var(--c); color: var(--t); text-align: left; font: 400 clamp(13px, 1vw, 15px)/1.25 var(--f-text); cursor: pointer; overflow: hidden; }
.em-cols__row img { width: 100%; height: 100%; object-fit: cover; }
.em-cols__n { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: clamp(14px, 2.4vh, 24px) clamp(14px, 1.7vw, 26px) 0; }
.em-cols__n b { font: 500 clamp(14px, 1.2vw, 18px)/1.2 var(--f-text); white-space: nowrap; }
.em-cols__n > span { display: grid; justify-items: end; gap: 5px; }
.em-cols__n i { padding: 3px 10px; border: 1px solid currentColor; border-radius: 999px; font-style: normal; font-size: 11px; line-height: 1.2; opacity: 0.8; white-space: nowrap; }
.em-cols__v { align-self: end; display: grid; gap: clamp(10px, 2vh, 18px); padding: 0 clamp(14px, 1.7vw, 26px) clamp(16px, 3vh, 28px); opacity: 0.8; }
.em-cols__v em { font-style: normal; }

/* ---------- The type ---------- */
.em-type .em-step__in { background: var(--paper); }
.em-type__p, .em-type__s { position: absolute; left: 4.3%; right: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6vw; align-items: end; padding: 3.4vh 5vw 3.4vh 2.7%; }
.em-type__p { top: 18%; height: 39.5%; background: var(--la); color: var(--mi); }
.em-type__s { top: 57.5%; bottom: 0; background: var(--vi); color: #fff; }
.em-type__p > div:first-child, .em-type__s > div:first-child { align-self: start; }
.em-type__k { margin: 0 0 clamp(8px, 1.6vh, 16px); font-size: clamp(13px, 1vw, 15px); }
.em-type__big { margin: 0 0 clamp(10px, 2.2vh, 22px); font-family: var(--f-text); font-weight: 500; font-size: clamp(2.2rem, 1.4rem + 2.6vw, 4rem); line-height: 1; letter-spacing: -0.01em; }
.em-type__big--s { font-family: var(--f-display); font-weight: 400; }
.em-type__row { display: flex; gap: clamp(32px, 6vw, 96px); margin: 0; font-size: clamp(13px, 1.05vw, 15.5px); line-height: 1.32; }
.em-type__p .em-type__row { font-family: var(--f-display); }
.em-type__use { font-size: clamp(12px, 0.95vw, 14px); line-height: 1.32; }
.em-type__use p { margin: 0 0 4px; }
.em-type__use ul { margin: 0; padding-left: 16px; list-style: disc; }

/* ---------- The tunnel ---------- */
.em-tunnel .st-reel__stage { perspective: 900px; }
.em-tunnel__in { position: absolute; inset: 0; transform-style: preserve-3d; }
.em-tunnel__in img { position: absolute; left: 50%; top: 50%; width: 58vw; height: auto; max-width: none; translate: -50% -50%; opacity: 0; visibility: hidden; will-change: transform, opacity; }

/* ---------- The end ---------- */
.em-end .em-step__in { display: grid; place-items: center; background: var(--paper); }
.em-end__logo { width: min(33vw, 560px); }
.em-end__logo svg { display: block; width: 100%; height: auto; }

@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (timeline-scope: none)) {
    /* as the next sheet comes up, this one sinks a little and dims */
    @keyframes em-sink { to { transform: translateY(-7vh); } }
    @keyframes em-dim { to { opacity: 0.28; } }
    .em-step__in { animation: em-sink auto linear both; animation-timeline: var(--out); animation-range: entry 0% entry 100%; }
    .em-step__in::after { animation: em-dim auto linear both; animation-timeline: var(--out); animation-range: entry 0% entry 100%; }
    .em-end .em-step__in, .em-end .em-step__in::after { animation: none; }
  }
}
@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .em-step { height: auto; margin-top: 0 !important; }
  .em-step__in { position: relative; height: auto; min-height: 0; padding: 32px var(--gutter); }
  .em-step__in > *, .em-tagged, .em-believe__fig > *, .em-mean__box, .em-clear__box, .em-mean__copy, .em-clear__copy, .em-cover__logo, .em-cover__t, .em-type__p, .em-type__s { position: relative !important; inset: auto !important; left: auto !important; top: auto !important; translate: none !important; width: auto; margin-block: 12px; }
  .em-mean__box, .em-clear__box, .em-cover__logo { width: 100%; }
  .em-intro .em-step__in, .em-half .em-step__in, .em-vm .em-step__in, .em-cols__row { flex-direction: column; }
  .em-vm__cards { grid-template-columns: minmax(0, 1fr); }
  .em-vm__bg { width: 100%; height: auto; }
  .em-intro__fig, .em-half__fig { height: auto; width: 100%; }
  .em-ai__t, .em-ai__a, .em-ai__b { width: auto; }
  .em-tunnel__in { display: grid; gap: 8px; }
  .em-tunnel__in img { position: static; width: 100%; translate: none; opacity: 1; visibility: visible; }
  /* stacked, nothing overlaps: the tunnel no longer slides up over the step before it */
  .em-tunnel { margin-top: 0 !important; }
  .em-intro__copy { padding: 8px 0 24px; }
}

/* scroll section heights, so they are in place before st-effectus.js runs (same numbers as its reel() calls) */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .em-tunnel { height: 860vh; }
}
