/*
 * revisions: unlimited revisions on the ink field.
 * Desktop: H2, then a pinned stage (steps left, artboard right).
 * Under 1024: the artboard is sticky at the top and the steps scroll beneath it.
 * The default (no JS, reduced motion) is the finished state: after layer shown,
 * marks at 20%, both comment pins visible, every step at full strength.
 */

.revisions.section { padding-bottom: calc(var(--section-y) * .55); overflow: clip; }

.revisions__head { row-gap: 18px; }
.revisions__eyebrow { grid-column: 1 / -1; }
.revisions__title { grid-column: 1 / -1; max-width: 11.5em; }
@media (min-width: 1024px) {
  .revisions__title { grid-column: 1 / span 10; }
}

/* ---------- steps ---------- */

.rv-steps { display: flex; flex-direction: column; }
.rv-step {
  display: grid;
  grid-template-columns: 1.3em 1fr;
  column-gap: 18px;
  align-items: start;
  font-size: var(--fs-counter);
}
.rv-step__num {
  display: block;
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 75%;
  font-size: 1em;
  line-height: .82;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
}
.rv-step__body { font-size: 1rem; padding-top: .2rem; }
.rv-step__title {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 96%;
  font-size: clamp(1.4rem, 1rem + 1.1vw, 2.125rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--paper);
}
.rv-step__line {
  margin-top: 10px;
  font-size: var(--fs-body);
  line-height: 1.55;
  max-width: 32ch;
  color: var(--mist);
}

/* ---------- artboard frame ---------- */

.rv-art__tilt {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  transform: rotate(-1.5deg);
}
.rv-art__tag {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 22px;
  transform: translateY(-55%) rotate(1.5deg);
  padding: 7px 10px 6px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--lime);
  box-shadow: 0 0 0 1px rgba(238, 237, 232, .28);
}
.artboard {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  background: var(--paper-hi);
  border: 1px solid var(--rule-c);
  box-shadow: var(--shadow-night);
  container-type: inline-size;
  color: var(--ink);
}

/* ---------- the miniature (all sizes in cqi so every layer lines up) ---------- */

.mini {
  --num: max(1.45cqi, 7px);
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 0 4.2cqi;
  background: var(--paper-hi);
}
.mini__header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqi;
  height: 8.6cqi;
  border-bottom: 1px solid var(--ink);
}
.mini__wordmark {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  isolation: isolate;
  font-family: var(--f-display);
  font-weight: 900;
  font-stretch: 100%;
  font-size: max(2.2cqi, 9px);
  line-height: 1;
  letter-spacing: -0.045em;
  text-transform: lowercase;
  white-space: nowrap;
}
.mini__mark {
  position: relative;
  z-index: -1;
  width: .62em;
  height: .27em;
  margin-left: -.30em;
  overflow: visible;
}
.mini__mark .dot { fill: var(--ink); }
.mini__call {
  display: inline-flex;
  align-items: baseline;
  gap: .55em;
  white-space: nowrap;
  font-size: var(--num);
  line-height: 1;
}
.mini__call-name {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 88%;
  font-size: 1.07em;
  letter-spacing: -0.01em;
}
.mini__num {
  position: relative;
  font-family: var(--f-body);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.mini--after .mini__num {
  font-size: 1.6em;
  font-weight: 800;
  letter-spacing: 0;
}

.mini__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4.4cqi;
  padding-block: 2cqi;
}
.mini__h1 {
  font-family: var(--f-display);
  font-weight: 900;
  font-stretch: 100%;
  font-size: 8.6cqi;
  line-height: .86;
  letter-spacing: -0.05em;
  text-wrap: nowrap;
  white-space: nowrap;
}
/* The miniature is paper, so its marks use the paper marker, not the ink-field lime block. */
.revisions .mini mark.hl {
  --hl-size: 100%;
  background: url('../../img/brand/marker.svg') no-repeat 0 92% / var(--hl-size) .46em;
  padding: 0 .04em;
  margin: 0 -.04em;
  border-radius: 0;
}
.revisions .mini mark.hl .hl__t {
  color: var(--ink);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
}
.mini__below { display: flex; flex-direction: column; gap: 2.4cqi; }
.mini__line {
  max-width: 44cqi;
  font-family: var(--f-body);
  font-size: max(1.55cqi, 6.5px);
  line-height: 1.45;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.mini__btns { display: flex; gap: 1.3cqi; }
.mini__btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: .55cqi;
  min-height: 5.6cqi;
  padding: 0 2.3cqi 0 2cqi;
  border-radius: .45cqi;
  white-space: nowrap;
}
.mini__btn--cobalt { background: var(--cobalt); color: #fff; }
.mini__btn--ink { background: var(--ink); color: var(--paper); }
.mini__btn-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: 88%;
  font-size: max(1.5cqi, 6.5px);
  line-height: 1;
}
.mini__btn-num {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: max(1.1cqi, 5.5px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  opacity: .82;
}
.mini__foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 7.4cqi;
  border-top: 1px solid var(--ink);
}
.mini__signoff {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 2.1cqi;
  letter-spacing: -0.04em;
  color: var(--cobalt);
  white-space: nowrap;
}

/* The edge of the fix as it wipes across (only visible while it moves). */
.rv-wipe {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}
.rv-wipe::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  transform: translateX(var(--wipe-x, 0cqi));
  background: var(--cobalt);
  box-shadow: 0 0 0 4px rgba(0, 56, 214, .08);
}
.mini--marks { z-index: 2; }

/* ---------- marks layer: invisible copy of the header anchoring the markup ---------- */

.mini--marks {
  background: none;
  visibility: hidden;
  pointer-events: none;
}
.mini--marks .mini__header { border-bottom-color: transparent; }
.rv-ink,
.rv-pins { visibility: visible; }
.rv-ink {
  position: absolute;
  max-width: none;
  overflow: visible;
  opacity: .2;
}
.rv-ink path {
  fill: none;
  stroke: var(--cobalt);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.rv-circle {
  left: -9%;
  top: -115%;
  width: 118%;
  height: 330%;
}
.rv-arrow {
  top: calc(100% + .9em);
  right: 22%;
  width: 6cqi;
  height: 21cqi;
}

.rv-pins {
  position: absolute;
  top: calc(100% + .9em + 22.5cqi);
  right: -.6cqi;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: max(.9cqi, 6px);
  font-size: clamp(11px, 1.75cqi, 14px);
}
.rv-pin {
  display: flex;
  align-items: center;
  gap: .6em;
  width: max-content;
  max-width: min(50cqi, 330px);
  padding: .55em .9em .55em .55em;
  border-radius: 1.3em 1.3em 1.3em .25em;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--rule-c);
  box-shadow: 0 1px 0 rgba(17, 17, 16, .05), 0 12px 24px -12px rgba(17, 17, 16, .4);
  font-family: var(--f-body);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.3;
  white-space: normal;
  transform-origin: 100% 0%;
}
.rv-pin b { font-weight: 600; }
.rv-pin__dot {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: var(--cobalt);
}
.rv-pin--you .rv-pin__dot::after {
  content: '';
  width: .5em;
  height: .5em;
  border-radius: 50%;
  background: #fff;
}
.rv-pin--us .rv-pin__dot { background: var(--lime); box-shadow: inset 0 0 0 1px rgba(17, 17, 16, .12); }
.rv-pin--us .rv-pin__dot svg { width: 1.1em; height: 1.1em; }
.rv-pin--us .rv-pin__dot path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rv-pin--us { margin-right: 2.2em; }

/* ---------- desktop: steps left, artboard right, pinned ---------- */

@media (min-width: 1024px) {
  .revisions__stage {
    display: flex;
    align-items: center;
    min-height: 100svh;
    padding-block: calc(56px + 5vh) 5vh;
  }
  .revisions__stage > .wrap { width: 100%; }
  .revisions__grid { align-items: center; }
  .rv-steps {
    grid-column: 1 / span 5;
    grid-row: 1;
    gap: clamp(28px, 5.5vh, 56px);
    padding-right: 12px;
  }
  .rv-art {
    grid-column: 6 / span 7;
    grid-row: 1;
  }
  .rv-art__tilt { width: min(100%, calc((100svh - 56px - 10vh - 40px) * 4 / 3)); }
}

/* ---------- under 1024: sticky artboard, steps scroll beneath ---------- */

@media (max-width: 1023px) {
  /* Where the sticky artboard stops: below the fixed header from 768 up. */
  .revisions { --rv-top: 12px; }
  .revisions__stage { margin-top: clamp(28px, 6vw, 48px); }
  .revisions__grid { display: block; }
  .rv-art {
    position: sticky;
    z-index: 2;
    top: var(--rv-top);
    height: min(52svh, calc((100vw - 2 * var(--gx)) * .75 + 60px));
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    box-shadow: 0 -12px 0 var(--ink), 0 14px 18px -6px var(--ink);
  }
  .rv-art__sticky { width: 100%; }
  .rv-art__tilt { width: min(100%, calc((52svh - 60px) * 4 / 3)); }
  .rv-steps {
    position: relative;
    z-index: 1;
    padding-top: 8svh;
    padding-bottom: 4svh;
  }
  .rv-step { min-height: 70svh; font-size: clamp(2.75rem, 2rem + 3vw, 3.5rem); }
  .rv-step:last-child { min-height: 0; padding-bottom: calc(18svh + var(--dock-h)); }
  /* The comments are dialogue, not labels: never below 12.5px. */
  .rv-pins { font-size: clamp(12.5px, 1.75cqi, 14px); }
  .rv-pin { max-width: min(58cqi, 330px); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  /* The header is fixed from 768 (64px, 56px once shrunk): stick clear of it. */
  .revisions { --rv-top: calc(var(--header-h) + 10px); }
  .rv-art { box-shadow: 0 -26px 0 var(--ink), 0 14px 18px -6px var(--ink); }
  .rv-steps { padding-left: calc((100% / 8) * 1); }
}
@media (max-width: 767px) {
  .rv-step { column-gap: 14px; }
  .rv-art__tag { left: 14px; }
}

/* ---------- landscape phones: artboard left (sticky), steps right ---------- */

@media (max-width: 1023px) and (orientation: landscape) and (max-height: 520px) {
  .revisions__grid {
    display: grid;
    grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
    column-gap: clamp(20px, 4vw, 40px);
    align-items: start;
  }
  .rv-art {
    grid-column: 1;
    grid-row: 1;
    height: calc(100svh - var(--rv-top) - 12px);
    box-shadow: none;
  }
  .rv-art__tilt { width: min(100%, calc((100svh - var(--rv-top) - 44px) * 4 / 3)); }
  .rv-steps {
    grid-column: 2;
    grid-row: 1;
    padding: 10svh 0 0;
  }
  .rv-step { min-height: 64svh; font-size: clamp(2.25rem, 1.5rem + 2vw, 2.75rem); column-gap: 14px; }
  .rv-step__title { font-size: clamp(1.3rem, 1rem + 1vw, 1.6rem); }
  .rv-step:last-child { padding-bottom: 24svh; }
}
