:root {
  --color-black: #0e1c1f;
  --color-scarlet: #e5451d;
  --color-blue: #5596d3;
  --color-green: #16c387;
  --color-yellow: #d8e684;
  --color-white: #ffffff;

  --font-heading: "Gluten", system-ui, sans-serif;
  --font-body: "Elms Sans", system-ui, sans-serif;

  --size-h1: 3rem;
  --size-p1: 1.5rem;
  --size-micro: 0.875rem;
  --tracking-micro: 0.7px;
  --tracking-p1: 1.2px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  gap: 57px;
  min-height: 100vh;
  margin: 0;
  background: var(--color-black);
  color: var(--color-white);
  font-family: var(--font-body);
  text-transform: uppercase;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--color-yellow);
  outline-offset: 4px;
}

main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 54px;
  padding: 0 40px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 40px;
}

.top-bar__identity {
  display: flex;
  align-items: center;
  gap: 21px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 21px;
  color: var(--color-scarlet);
  font-size: var(--size-h1);
}

.brand__icon {
  flex-shrink: 0;
  translate: 0 -0.095em;
}

.brand__name {
  font-family: var(--font-heading);
  font-size: var(--size-h1);
  line-height: 50px;
  min-width: 307px;
  white-space: nowrap;
}

.top-bar__tagline {
  color: var(--color-green);
  font-size: var(--size-micro);
  letter-spacing: var(--tracking-micro);
  white-space: nowrap;
}

.top-bar__nav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--color-yellow);
  font-size: var(--size-micro);
  letter-spacing: var(--tracking-micro);
  white-space: nowrap;
}

.nav-link {
  display: block;
  opacity: 0.5;
}

a.nav-link:focus-visible,
.nav-link[aria-current="page"] {
  opacity: 1;
}

@media (hover: hover) {
  a.nav-link:hover {
    opacity: 1;
  }
}

.intro {
  display: flex;
  flex-direction: column;
  gap: 45px;
  width: 100%;
  max-width: 1191px;
}

.intro__portrait {
  display: block;
  width: 240px;
  height: 240px;
  outline: 4px solid var(--color-scarlet);
  outline-offset: -4px;
  image-rendering: pixelated;
}

.intro__text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.intro__heading {
  margin: 0;
  color: var(--color-scarlet);
  font-family: var(--font-heading);
  font-size: var(--size-h1);
  font-weight: 400;
  line-height: normal;
}

.intro__body {
  max-width: 941px;
  color: var(--color-white);
  font-size: var(--size-p1);
  font-weight: 700;
  letter-spacing: var(--tracking-p1);
}

body.page-about {
  gap: 20px;
}

.page-about main {
  gap: 60px;
}

/* Figma's 36px text box for the 48px heading. */
.about-heading {
  width: 100%;
  line-height: 0.75;
  text-align: center;
}

/* Portrait and gap shrink with the window from their 1728 sizes, 390 and 244. */
.about-intro {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(48px, 14.12vw, 244px);
  width: 100%;
  max-width: 1478px;
  padding: 45px;
}

.about-intro__portrait {
  display: block;
  flex: none;
  width: clamp(240px, 22.57vw, 390px);
  height: auto;
  aspect-ratio: 1;
  outline: 4px solid var(--color-scarlet);
  outline-offset: -4px;
  image-rendering: pixelated;
}

.about-intro__text {
  display: flex;
  flex: 0 1 754px;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.about-intro__body {
  color: var(--color-white);
  font-size: var(--size-p1);
  font-weight: 700;
  letter-spacing: var(--tracking-p1);
}

/* One empty line between paragraphs, as in Figma. */
.about-intro__body p + p {
  margin-top: 1lh;
}

/* Motion + Magic (Figma 472:164), Design + Details (Figma 490:498), and UX + UI (Figma 491:65): 54px between sections. */
body.page-motion,
body.page-design,
body.page-ux {
  gap: 54px;
}

.page-motion main,
.page-design main,
.page-ux main {
  gap: 54px;
  padding: 0;
}

/* Shrinks on very narrow phones so the heading stays on one line. */
.motion-heading,
.design-heading,
.ux-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.396em;
  margin: 0;
  padding: 0 16px;
  color: var(--color-blue);
  font-family: var(--font-heading);
  font-size: min(var(--size-h1), 9.5vw);
  font-weight: 400;
  line-height: normal;
  white-space: nowrap;
}

/* 43 x 42 at the 48px heading size. */
.motion-heading__icon {
  display: block;
  flex: none;
  width: 0.896em;
  height: 0.875em;
}

/* Design + Details heading (Figma 490:546): scarlet, with a 26px green Icon B at the 48px size. */
.design-heading {
  color: var(--color-scarlet);
}

.design-heading__icon {
  display: block;
  flex: none;
  width: 0.542em;
  height: 0.542em;
}

/* UX + UI heading (Figma 491:79): green, with a 30px blue Icon C at the 48px size. */
.ux-heading {
  color: var(--color-green);
}

.ux-heading__icon {
  display: block;
  flex: none;
  width: 0.625em;
  height: 0.625em;
}

/* Project cards (Figma 491:24): three 522 x 360 cards, 54px apart, 27px from the
   window edges at 1728. They reuse .card for shape, scaling, and the label. */
.project-row {
  display: flex;
  justify-content: center;
  gap: 54px;
  width: calc(100% - 54px);
  max-width: 1674px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Each list item holds one card (a link or a plain block) and takes the card's flex sizing. */
.project-row__item {
  flex: 1 1 0;
  min-width: 0;
  max-width: 522px;
}

.project-row__item > .card {
  width: 100%;
}

.card--sop {
  background: var(--color-scarlet);
}

.card--visual {
  background: var(--color-blue);
}

.card--donor {
  background: var(--color-yellow);
}

.card--project .card__label {
  margin: 0;
  font-weight: 400;
}

/* The blank line before "Coming soon..." in Figma. */
.card__line--after-gap {
  margin-top: 1lh;
}

/* Icon B art, positioned as a share of the 522 x 360 card. */
.card--sop .card__art {
  top: -3.89%;
  left: 62.84%;
  width: 74.33%;
  height: 107.78%;
}

.card--visual .card__art {
  top: -4.44%;
  left: 57.47%;
  width: 52.3%;
  height: 75.83%;
}

.card--donor .card__art {
  top: 0;
  left: -9.58%;
  width: 119.16%;
  height: 172.78%;
}

/* UX + UI project cards (Figma 491:83): yellow, scarlet, green, each with blue Icon C art. */
.card--civic {
  background: var(--color-yellow);
}

.card--heal {
  background: var(--color-scarlet);
}

.card--indy {
  background: var(--color-green);
}

/* Icon C art, positioned as a share of the 522 x 360 card. */
.card--civic .card__art {
  top: -33.33%;
  left: 18.39%;
  width: 114.94%;
  height: 166.94%;
}

.card--heal .card__art {
  top: 26.94%;
  left: 54.02%;
  width: 42.72%;
  height: 61.94%;
}

.card--indy .card__art {
  top: -80.83%;
  left: -24.71%;
  width: 249.23%;
  height: 361.67%;
}

/* The switch bar and the whole reel fit in the window (D0021, D0027): full width when
   the window is tall enough, otherwise narrower and centered. --reel-top is the space
   above the video: top bar, heading, and gaps (218px: the gap under the heading is 32px, D0032),
   plus the 68px switch row and a 16px gap (D0030).
   24px stays free below the video. Never narrower than 480px. */
.reel-block {
  --reel-top: 302px;
  /* 54px page gap minus 22px leaves 32px under the heading (D0032). */
  margin-top: -22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(100%, max(480px, calc((100vh - var(--reel-top) - 24px) * 16 / 9)));
  width: min(100%, max(480px, calc((100svh - var(--reel-top) - 24px) * 16 / 9)));
}

/* Switch row at the reel's right edge on large screens (D0031); the mobile text
   choices stay centered (D0027). */
.reel-bar {
  display: flex;
  justify-content: flex-end;
}

.reel-bar:has(> .reel-switch[hidden]) {
  display: none;
}

.reel-bar:has(> .reel-switch.is-text) {
  justify-content: center;
}

.reel {
  position: relative;
}

.reel__frame {
  aspect-ratio: 16 / 9;
  background: #000;
}

.reel__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Phones and touch screens: buttons centered below the reel (D0021). */
.reel__controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.reel__controls[hidden] {
  display: none;
}

.reel__button {
  min-height: 44px;
  padding: 10px 24px;
  border: 1px solid var(--color-yellow);
  border-radius: 100px;
  background: rgba(14, 28, 31, 0.85);
  color: var(--color-yellow);
  font-family: var(--font-body);
  font-size: var(--size-micro);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.5;
}

/* Icon buttons (D0026): pause bars or play triangle; speaker with a slash or with waves.
   Playing shows the pause icon (the action); muted shows the slashed speaker (the state). */
.reel__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 10px 20px;
}

.reel__icon {
  display: block;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.reel__icon-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.reel__button[data-state="paused"] .reel__icon--pause,
.reel__button[data-state="playing"] .reel__icon--play,
.reel__button[data-state="muted"] .reel__icon--sound,
.reel__button[data-state="sound"] .reel__icon--muted {
  display: none;
}

/* Same as Resume and IMDB (D0012, D0022): 50% at rest, 100% on hover or keyboard focus. */
.reel__button:focus-visible {
  outline: 2px solid var(--color-yellow);
  outline-offset: 4px;
  opacity: 1;
}

@media (hover: hover) {
  .reel__button:hover {
    opacity: 1;
  }
}

/* Larger screens with a mouse: buttons on the reel, shown only while hovering it,
   or while a button has keyboard focus (D0021). */
@media (hover: hover) and (pointer: fine) and (min-width: 601px) {
  .reel__controls {
    position: absolute;
    right: 24px;
    bottom: 24px;
    margin: 0;
    opacity: 0;
    transition: opacity 0.2s;
  }

  .reel:hover .reel__controls,
  .reel__controls:has(:focus-visible) {
    opacity: 1;
  }
}

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

/* Row under the reel (Figma 478:277): Resume and IMDB, centered; the switch moved above the reel (D0027). */
.reel-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: min(1320px, 100% - 80px);
}

/* Large screens (D0030): "Motion Graphics", the switch turned on its side, "VFX", in one
   centered row. Selected label 100%, the other 50%; hover and focus 100% (D0018, D0024). */
.reel-switch {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--color-yellow);
  font-size: var(--size-p1);
  font-weight: 700;
  letter-spacing: var(--tracking-p1);
  line-height: normal;
  white-space: nowrap;
}

.reel-switch[hidden] {
  display: none;
}

/* Plain text, no button look. */
.reel-switch__label {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  opacity: 0.5;
}

.reel-switch__label.is-selected,
.reel-switch__label:focus-visible {
  opacity: 1;
}

.reel-switch__label:focus-visible {
  outline: 2px solid var(--color-yellow);
  outline-offset: 4px;
}

@media (hover: hover) {
  .reel-switch__label:hover {
    opacity: 1;
  }
}

/* The 68 x 104 Switch 478:263 artwork, turned -90deg so it lies flat in a 104 x 68 button:
   its top end (Motion Graphics) is now on the left, its bottom end (VFX) on the right.
   The track stays still (D0023); only the knob slides, 0.3s, 60px (D0025). */
.reel-switch__toggle {
  position: relative;
  flex: none;
  width: 104px;
  height: 68px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.reel-switch__toggle:focus-visible {
  outline: 2px solid var(--color-yellow);
  outline-offset: 4px;
}

.reel-switch__art {
  position: absolute;
  top: -18px;
  left: 18px;
  width: 68px;
  height: 104px;
  rotate: -90deg;
}

.reel-switch__track {
  position: absolute;
  top: 49.5px;
  left: 0;
  width: 68px;
  height: 11px;
  rotate: 90deg;
}

/* The exported knob faces the other way; Figma shows it mirrored. */
.reel-switch__knob {
  position: absolute;
  top: 0.8px;
  left: 4.8px;
  width: 59.4px;
  height: 56.4px;
  scale: -1 1;
  transition: translate 0.3s ease-in-out;
}

.reel-switch.is-vfx .reel-switch__knob {
  translate: 0 60px;
}

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

/* Mobile (D0024): no switch graphic; the two labels are side-by-side text choices,
   above the reel (D0027). The script sets is-text wherever Pause and Sound sit below
   the reel. */
.reel-switch.is-text {
  gap: 32px;
}

.reel-switch.is-text .reel-switch__toggle {
  display: none;
}

.reel-switch.is-text .reel-switch__label {
  min-height: 44px;
}

/* Scarlet divider (Figma 478:276, 517:210). */
.divider {
  display: block;
  flex: none;
}

/* Poster row (Figma 472:181): 11px apart, square corners, centered when it fits.
   When it does not, it scrolls sideways inside itself; the page never does. */
.posters {
  --poster-height: 336px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: rgba(216, 230, 132, 0.5) transparent;
  scrollbar-width: thin;
}

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

.posters__list {
  display: flex;
  gap: 11px;
  width: max-content;
  margin: 0 auto;
  padding: 0 16px;
  list-style: none;
}

.posters__list img {
  display: block;
  width: auto;
  height: var(--poster-height);
  object-fit: cover;
}

/* Card row (Figma 517:182, 517:154, 517:168). These pages' main area has no side padding, so the
   row keeps the 40px side margin of the other pages (24px and 16px on smaller screens). */
.page-motion .work-row,
.page-design .work-row,
.page-ux .work-row,
.page-sop .work-row {
  width: calc(100% - 80px);
}

.icon-row {
  display: block;
  max-width: 100%;
  height: auto;
}

.work-row {
  display: flex;
  justify-content: center;
  gap: 41px;
  width: 100%;
  max-width: 1648px;
  padding: 40px 0;
}

.card {
  position: relative;
  display: block;
  flex: 1 1 0;
  max-width: 522px;
  aspect-ratio: 522 / 360;
  overflow: hidden;
  border-radius: 40px;
  color: var(--color-black);
  container-type: inline-size;
}

.card--motion {
  background: var(--color-blue);
}

.card--design {
  background: var(--color-scarlet);
}

.card--ui {
  background: var(--color-green);
}

/* Art position and size as a share of the 522 x 360 card, so the crop matches Figma at any width. */
.card__art {
  position: absolute;
  max-width: none;
}

.card--motion .card__art {
  top: -28.5%;
  left: 31.99%;
  width: 108.24%;
  height: 156.58%;
}

.card--design .card__art {
  top: -4.17%;
  left: 13.41%;
  width: 110.54%;
  height: 160%;
}

.card--ui .card__art {
  top: -28.64%;
  left: 30.08%;
  width: 107.47%;
  height: 156.94%;
}

/* 40px inset and 48px type at the 522px design width. */
.card__label {
  position: absolute;
  top: 7.28cqw;
  left: 7.66cqw;
  font-family: var(--font-heading);
  font-size: var(--size-h1);
  font-size: 9.195cqw;
  line-height: normal;
}

.card__line {
  display: block;
  white-space: nowrap;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
}

.button {
  display: block;
  padding: 10px 40px;
  border: 1px solid var(--color-yellow);
  border-radius: 100px;
  background: var(--color-black);
  color: var(--color-yellow);
  font-size: var(--size-p1);
  font-weight: 700;
  letter-spacing: var(--tracking-p1);
  white-space: nowrap;
  opacity: 0.5;
}

.button:focus-visible {
  opacity: 1;
}

@media (hover: hover) {
  .button:hover {
    opacity: 1;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.footnote {
  padding: 30px;
  color: var(--color-green);
  font-size: var(--size-micro);
  letter-spacing: var(--tracking-micro);
}

/* Portrait above the text, as in the homepage intro. */
@media (max-width: 1100px) {
  .about-intro {
    flex-direction: column;
    gap: 45px;
    padding: 24px 0;
  }

  .about-intro__portrait {
    width: 240px;
  }

  .about-intro__text {
    flex: none;
    width: 100%;
    max-width: 754px;
  }
}

@media (max-width: 900px) {
  .top-bar {
    padding: 20px 24px;
  }

  main {
    padding: 0 24px;
  }

  .work-row {
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 0;
  }

  .card {
    flex: none;
    width: 100%;
  }

  .top-bar__identity {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .footnote {
    padding: 30px 24px;
  }

  .reel-block {
    --reel-top: 324px;
  }

  .reel-row {
    flex-direction: column;
    gap: 32px;
  }

  .page-motion .work-row,
  .page-design .work-row,
  .page-ux .work-row,
  .page-sop .work-row {
    width: calc(100% - 48px);
  }

  .project-row {
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: calc(100% - 48px);
  }

  .project-row__item {
    flex: none;
    width: 100%;
  }
}

@media (max-width: 600px) {
  :root {
    --size-h1: 2.25rem;
    --size-p1: 1.125rem;
  }

  body {
    gap: 32px;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .brand {
    gap: 12px;
  }

  .brand__name {
    min-width: 0;
  }

  main {
    padding: 0 16px;
  }

  .intro__portrait {
    width: 180px;
    height: 180px;
  }

  .about-intro {
    padding: 8px 0;
  }

  .about-heading {
    line-height: normal;
  }

  .about-intro__portrait {
    width: 180px;
  }

  .reel-block {
    --reel-top: 312px;
  }

  .posters {
    --poster-height: 240px;
  }

  .page-motion .work-row,
  .page-design .work-row,
  .page-ux .work-row,
  .page-sop .work-row,
  .project-row {
    width: calc(100% - 32px);
  }

  .button-row {
    gap: 16px;
  }

  .button {
    min-height: 44px;
    padding: 10px 32px;
  }

  .footnote {
    padding: 24px 16px;
  }
}

/* State of the Port case study (Figma 497:213). */
body.page-sop {
  gap: 54px;
}

.page-sop main {
  gap: 54px;
  padding: 0;
}

/* Banner (Figma 497:269): full-width photo, 697 tall at 1728, with the top bar over it. */
.sop-banner {
  position: relative;
}

.sop-banner__photo {
  display: block;
  width: 100%;
  height: auto;
  min-height: 240px;
  aspect-ratio: 1728 / 697;
  object-fit: cover;
}

/* Darkens only the top of the photo so the white top bar stays readable over the bright ceiling. */
.sop-banner::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 220px;
  background: linear-gradient(rgba(14, 28, 31, 0.6), rgba(14, 28, 31, 0));
  pointer-events: none;
  z-index: 1;
}

.sop-banner .top-bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  padding: 40px 80px;
}

.top-bar--light .brand,
.top-bar--light .top-bar__tagline,
.top-bar--light .top-bar__nav {
  color: var(--color-white);
}

.top-bar--light a:focus-visible {
  outline-color: var(--color-white);
}

/* Three 9.14px bars: scarlet, green, blue (Figma 497:263). */
.sop-stripe {
  height: 27.43px;
  background: linear-gradient(
    var(--color-scarlet) 0 33.333%,
    var(--color-green) 33.333% 66.667%,
    var(--color-blue) 66.667% 100%
  );
}

/* Header (Figma 497:280). */
.sop-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  width: 100%;
  padding: 0 40px;
  text-align: center;
}

.sop-header__title {
  margin: 0;
  color: var(--color-scarlet);
  font-family: var(--font-heading);
  font-size: var(--size-h1);
  font-weight: 400;
  line-height: normal;
}

.sop-header__line {
  display: block;
}

.sop-header__subtext {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: var(--size-p1);
  letter-spacing: var(--tracking-p1);
}

.sop-header__dates {
  font-weight: 700;
}

/* The sections sit directly against each other, with no gap between bands. */
.sop-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Content sections (Figma 498:331): full-width bands, text column beside a picture. */
/* The label and text are centered on the picture's middle line (D0041); Figma's fixed text-box heights are not used. */
.sop-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 54px;
  width: 100%;
  padding: 20px clamp(40px, 7.523vw, 130px);
}

.sop-section__text {
  display: flex;
  flex: 1 1 697px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 40px;
  min-width: 0;
  padding: 54px 0;
}

/* Section labels look like the pill buttons but are headings, not links. */
.sop-label {
  margin: 0;
  padding: 10px 40px;
  border: 1px solid var(--color-yellow);
  border-radius: 100px;
  color: var(--color-yellow);
  font-size: var(--size-p1);
  font-weight: 700;
  line-height: normal;
  letter-spacing: var(--tracking-p1);
  max-width: 100%;
}

.sop-copy {
  font-size: var(--size-p1);
  font-weight: 500;
  letter-spacing: var(--tracking-p1);
}

.sop-copy p + p {
  margin-top: 1lh;
}

.sop-copy__link {
  color: var(--color-yellow);
  opacity: 0.5;
}

/* Same idle and hover look as the other links (D0011). */
.sop-copy__link:focus-visible {
  opacity: 1;
}

@media (hover: hover) {
  .sop-copy__link:hover {
    opacity: 1;
  }
}

.sop-context__photo {
  display: block;
  flex: 0 1 717px;
  min-width: 0;
  height: auto;
  aspect-ratio: 717 / 573;
  object-fit: cover;
}

/* Colored bands: black text and black pill outline. */
.sop-section--blue {
  background: var(--color-blue);
}

.sop-section--green {
  background: var(--color-green);
}

.sop-section--yellow {
  background: var(--color-yellow);
}

.sop-section--blue,
.sop-section--blue .sop-label,
.sop-section--yellow,
.sop-section--yellow .sop-label,
.sop-section--green,
.sop-section--green .sop-label {
  color: var(--color-black);
}

.sop-section--blue .sop-label,
.sop-section--yellow .sop-label,
.sop-section--green .sop-label {
  border-color: var(--color-black);
}

/* Step 1 (Figma 498:311): graphic 833 x 996 on the left, text column 733. */
.sop-step1 {
  padding: 90px 54px;
}

.sop-step1 .sop-section__text {
  flex-basis: 733px;
  justify-content: center;
}

.sop-step1__graphic {
  order: -1;
  flex: 0 1 833px;
  min-width: 0;
}

/* The image is 836 x 999 (3 px of chart shadow past Figma's 833 x 996 box). */
.sop-step1__graphic img {
  display: block;
  width: 100.36%;
  height: auto;
  margin-bottom: -0.36%;
}

/* Step 2 (Figma 498:330): two 707 columns, then "Results". The palette and specimen
   run past the right edge and are cut off there, without a sideways scroll bar. */
.sop-step2 {
  flex-direction: column;
  overflow-x: clip;
}

.sop-step2__row {
  display: flex;
  align-items: center;
  gap: 54px;
  width: 100%;
}

.sop-step2 .sop-section__text {
  flex: 1 1 0;
}

.sop-copy strong {
  font-weight: 700;
}

.sop-step2__brand {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 106px;
  min-width: 0;
}

.sop-palette {
  display: flex;
  flex: none;
  gap: 33px;
  padding: 0 47px;
}

.sop-palette__swatch {
  flex: none;
  width: 278px;
  height: 278px;
}

.sop-palette__swatch--deep {
  background: #00228c;
}

.sop-palette__swatch--green {
  background: #6ce100;
}

.sop-palette__swatch--light {
  width: 277px;
  background: #1e90ff;
}

.sop-specimen {
  display: block;
  flex: none;
  max-width: none;
  height: 250px;
  width: auto;
}

.sop-results {
  display: flex;
  align-self: center;
  align-items: center;
  font-size: var(--size-p1);
  font-weight: 500;
  letter-spacing: var(--tracking-p1);
}

/* Figma's 129 px box around "Results" leaves about 9.5 px on each side of the word. */
.sop-results__text {
  padding: 0 9.5px;
}

.sop-results__arrow {
  display: block;
  flex: none;
}

/* Before and after (Figma 500:39, D0038): 1522 x 881 at 1728, centered. The chart is
   clipped to the left of the line; the finished slide fills the rest. */
.sop-compare-section {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow-x: clip;
}

.sop-compare {
  --position: 50%;
  position: relative;
  width: min(1522px, 88.08%);
  aspect-ratio: 1522 / 881;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.sop-compare__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.sop-compare__before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--position)) 0 0);
}

/* A 6 px yellow line with a 54 px yellow circle; the whole 54 px strip is the touch target.
   At either end the circle stays whole, reaching past the box edge. */
.sop-compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--position);
  width: 54px;
  translate: -50% 0;
  outline: none;
}

.sop-compare__handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 24px;
  width: 6px;
  background: var(--color-yellow);
}

.sop-compare__handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--color-yellow);
  translate: 0 -50%;
}

.sop-compare__handle:focus-visible::after {
  outline: 2px solid var(--color-yellow);
  outline-offset: 4px;
}

/* Step 3 (Figma 502:102): two 804 x 452 videos stacked 54 apart on the left, text column 624.
   Together 1482 wide, so Figma centers them about 123 px from each edge (inside its 130 px padding).
   The text column takes half a pixel more so the label fits on one line, as drawn. */
.sop-step3 {
  padding: 90px clamp(40px, 7.089vw, 122.5px);
}

.sop-step3 .sop-section__text {
  flex: 1 1 624px;
}

.sop-step3__videos {
  display: flex;
  flex: 0 1 804px;
  flex-direction: column;
  gap: 54px;
  order: -1;
  min-width: 0;
}

.sop-step3__video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 804 / 452.125;
  object-fit: cover;
  background: var(--color-black);
}

/* That's a wrap (Figma 504:119): text 722 wide in Elms Sans Regular, photo 692 x 521. */
.sop-wrap .sop-section__text {
  flex: 1 1 722px;
}

/* Figma draws Elms Sans Regular at 35 px per line for 24 px text. */
.sop-copy--regular {
  font-weight: 400;
  line-height: 1.4583;
}

.sop-wrap__photo {
  display: block;
  flex: 0 1 692px;
  min-width: 0;
  height: auto;
  aspect-ratio: 692 / 521;
  object-fit: cover;
}

/* "See More of my work!" (Figma 504:142). Figma's text box is two lines tall; the empty
   second line is left out at the human's request (E0201), so the cards sit 54 px below. */
.sop-more-heading {
  margin: 0;
  padding: 0 40px;
  color: var(--color-scarlet);
  font-family: var(--font-heading);
  font-size: var(--size-h1);
  font-weight: 400;
  line-height: normal;
  text-align: center;
}

@media (max-width: 900px) {
  .sop-banner .top-bar {
    padding: 20px 24px;
  }

  .sop-header {
    padding: 0 24px;
  }

  /* Text first, picture below at the full column width. */
  .sop-section {
    flex-direction: column;
    align-items: stretch;
    gap: 32px;
    padding: 0 24px;
  }

  .sop-section__text {
    flex: none;
    padding: 0;
  }

  .sop-context__photo {
    flex: none;
    width: 100%;
  }

  /* Space under the crane photo, same as the colored steps, so it does not touch the blue band (E0212). */
  .sop-context {
    padding-bottom: 48px;
  }

  .sop-step1 {
    padding: 48px 24px;
  }

  .sop-step1 .sop-section__text {
    flex-basis: auto;
  }

  .sop-step2 {
    padding: 48px 24px;
    gap: 40px;
  }

  .sop-step2__row {
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
  }

  .sop-step2 .sop-section__text,
  .sop-step2__brand {
    flex: none;
  }

  .sop-step2__brand {
    gap: 40px;
  }

  .sop-palette {
    width: 100%;
    max-width: 600px;
    gap: 16px;
    padding: 0;
  }

  .sop-palette__swatch,
  .sop-palette__swatch--light {
    flex: 1 1 0;
    width: auto;
    height: auto;
    aspect-ratio: 1;
  }

  .sop-specimen {
    height: 140px;
  }

  .sop-compare-section {
    padding: 0 24px;
  }

  .sop-compare {
    width: 100%;
  }

  .sop-step3 {
    padding: 48px 24px;
  }

  .sop-step3 .sop-section__text,
  .sop-step3__videos {
    flex: none;
  }

  .sop-step3__videos {
    order: 0;
    gap: 24px;
  }

  /* Same top and bottom space as the colored steps, so the label clears the green band. */
  .sop-wrap {
    padding: 48px 24px;
  }

  .sop-wrap .sop-section__text,
  .sop-wrap__photo {
    flex: none;
  }

  .sop-wrap__photo {
    width: 100%;
  }

  .sop-more-heading {
    padding: 0 24px;
  }

  .sop-step1__graphic {
    order: 0;
    flex: none;
    width: 100%;
    max-width: 833px;
    align-self: center;
  }

  /* On smaller screens the top bar covers more of the photo, so the shading reaches further down. */
  .sop-banner::before {
    inset: 0 0 27.43px;
    height: auto;
    background: linear-gradient(rgba(14, 28, 31, 0.75), rgba(14, 28, 31, 0.6) 140px, rgba(14, 28, 31, 0));
  }
}

@media (max-width: 600px) {
  body.page-sop {
    gap: 32px;
  }

  .page-sop main {
    gap: 32px;
  }

  .sop-banner .top-bar {
    padding: 16px;
  }

  .sop-banner::before {
    background: linear-gradient(rgba(14, 28, 31, 0.8), rgba(14, 28, 31, 0.72) 134px, rgba(14, 28, 31, 0));
  }

  .sop-header__subtext {
    gap: 12px;
  }

  .sop-header,
  .sop-section {
    padding: 0 16px;
  }

  .sop-step1 {
    padding: 40px 16px;
  }

  .sop-step2 {
    padding: 40px 16px;
  }

  .sop-palette {
    gap: 12px;
  }

  .sop-specimen {
    height: 100px;
  }

  .sop-compare-section {
    padding: 0 16px;
  }

  .sop-step3 {
    padding: 40px 16px;
  }

  .sop-step3__videos {
    gap: 16px;
  }

  .sop-more-heading {
    padding: 0 16px;
  }

  .sop-wrap {
    padding: 40px 16px;
  }

  .sop-context {
    padding-bottom: 40px;
  }

  .sop-section__text {
    gap: 24px;
  }

  .sop-label {
    padding: 10px 32px;
  }
}

/* UX + UI case studies (Figma 531:836, 525:383, 533:1039; D0044): 54px under the top bar,
   then a translucent yellow panel (#D8E684 at 70% over the black page) that holds the back
   arrow, the description card beside the large screenshot, and the footnote. */
body.page-case {
  gap: 54px;
}

.case-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  background: rgb(216 230 132 / 0.7);
  color: var(--color-black);
}

.page-case main {
  align-items: stretch;
  gap: 30px;
  padding: 30px;
}

/* The site's yellow focus ring would vanish on the yellow panel. */
.case-panel a:focus-visible {
  outline-color: var(--color-black);
}

/* « at 30/30 as drawn (15.5 x 20); the padding gives a 40 x 44 tap area without moving it. */
.case__back {
  display: block;
  align-self: flex-start;
  margin: -12px;
  padding: 12px;
}

.case__back img {
  display: block;
  width: auto;
  height: 20px;
}

/* Card and screenshot, 54px apart, centered (1647px wide at 1728). */
.case__content {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 54px;
}

.case__side {
  display: flex;
  flex: 0 0 460px;
  flex-direction: column;
  gap: 25px;
}

/* Description card (component 517:249): white, 1px outline, solid 3px shadow, 37px inside,
   927px tall on wide screens so every case study's card matches. */
.case__card {
  display: flex;
  flex-direction: column;
  gap: 45px;
  min-height: 927px;
  padding: 36px;
  border: 1px solid var(--color-black);
  background: var(--color-white);
  box-shadow: 3px 3px 0 #000;
}

.case__title {
  margin: 0;
  font-size: var(--size-p1);
  font-weight: 700;
  letter-spacing: var(--tracking-p1);
  line-height: normal;
  /* Figma's fixed 35px title box, text centered in it; a second line spills evenly above
     and below, so the facts always start at the same height. */
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 35px;
}

.case__facts {
  margin: 0;
  font-size: var(--size-micro);
  letter-spacing: var(--tracking-micro);
  line-height: normal;
}

/* One empty line between groups, as in Figma. */
.case__facts > div + div {
  margin-top: 1lh;
}

.case__facts dt {
  font-weight: 800;
}

.case__facts dd {
  margin: 0;
}

.case__facts dd p + p,
.case__facts dd p + ul,
.case__facts li + li {
  margin-top: 1lh;
}

.case__facts ul {
  margin: 0;
  padding-left: 1.5em;
}

/* Thumbnails (Figma 528:507): 210 x 210, 40px apart, 25px under the card, same outline and
   shadow as the large view. Each crops its screen as drawn. Shown by gallery.js. */
.case__thumbs {
  display: flex;
  gap: 40px;
}

.case__thumbs[hidden],
.case__thumb[hidden] {
  display: none;
}

.case__thumb {
  position: relative;
  flex: 0 1 210px;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-black);
  border-radius: 6px;
  background: var(--color-black);
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.case__thumb:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 4px;
}

.case__thumb img {
  position: absolute;
  max-width: none;
  height: auto;
}

/* Crops as a share of the 210px thumbnail. */
.case__thumb--officials img {
  top: 0;
  left: 0;
  width: 107.62%;
}

.case__thumb--landing img {
  top: 0;
  left: -1.9%;
  width: 111.9%;
}

.case__thumb--results img {
  top: -3.33%;
  left: -2.38%;
  width: 126.67%;
}

/* Indyrx thumbnails (Figma 533:1050, 533:1152, 533:1197). */
.case__thumb--appointments img {
  top: 0.48%;
  left: -36.43%;
  width: 173.33%;
}

.case__thumb--dashboard img {
  top: 0;
  left: 0;
  width: 103.81%;
}

.case__thumb--treatment img {
  top: 0;
  left: -3.33%;
  width: 103.33%;
}

.case__divider {
  display: block;
  align-self: center;
  margin-top: auto;
}

/* Large screenshot (Figma Viewport): 1133px wide, rounded 6px, same outline and shadow. */
.case__shot {
  flex: 0 1 1133px;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--color-black);
  border-radius: 6px;
  background: var(--color-white);
  box-shadow: 3px 3px 0 #000;
}

.case__shot img {
  display: block;
  width: 100%;
  height: auto;
}

.case-panel .footnote {
  color: var(--color-black);
}

/* Tablets and phones: card, then thumbnails, then the screenshot, in one centered column. */
@media (max-width: 1100px) {
  .case__content {
    flex-direction: column;
    align-items: stretch;
    gap: 32px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
  }

  .case__side {
    flex: none;
  }

  .case__card {
    min-height: 0;
  }

  .case__shot {
    flex: none;
  }
}

@media (max-width: 900px) {
  .page-case main {
    padding: 24px;
  }
}

@media (max-width: 600px) {
  body.page-case {
    gap: 32px;
  }

  .page-case main {
    gap: 24px;
    padding: 24px 16px;
  }

  .case__card {
    gap: 32px;
    padding: 23px;
  }

  .case__title {
    height: auto;
  }

  .case__thumbs {
    gap: 16px;
  }
}
