/* ============================================
   CAMPAIGNS — page styles
   ============================================ */

/* Reuse .cases.* from social.css (paste shared if not loaded) */
.cases {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto auto;
  gap: 0 20px;
  align-items: start;
  position: relative;
}

.cases__bg {
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 20px;
  z-index: 0;
}

.cases__card { background: var(--c-cream-dark); border-radius: 4px; }

.cases__cell { position: relative; z-index: 1; padding-left: 28px; padding-right: 28px; }

.cases__cell--eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--c-navy);
  opacity: 0.5;
  font-weight: 500;
  padding-top: 32px;
}

.cases__cell--name {
  font-size: 28px;
  line-height: 1.1;
  color: var(--c-navy);
  font-weight: 500;
  letter-spacing: -0.8px;
  padding-top: 16px;
}

.cases__cell--tag {
  font-size: 12px;
  color: var(--c-navy);
  opacity: 0.55;
  padding-top: 8px;
}

.cases__cell--result {
  font-size: 20px;
  line-height: 1.25;
  color: var(--c-navy);
  font-weight: 400;
  letter-spacing: -0.3px;
  padding-top: 64px;
  padding-bottom: 32px;
}


/* ============ THE PROCESS — CYCLICAL LOOP ============ */
.loop {
  position: relative;
  width: 100%;
  height: 540px;
  max-width: 600px;
  margin: 0 auto;
}

.loop__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(25, 40, 65, 0.2);
  border-radius: 50%;
}

@keyframes loop-orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loop__orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  animation: loop-orbit 12s linear infinite;
  transform-origin: center center;
}

.loop__dot {
  position: absolute;
  top: -7px;
  left: -7px;
  transform: translate(0, -200px);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c-orange);
  box-shadow:
    0 0 0 3px rgba(244, 162, 97, 0.35),
    0 0 14px 2px rgba(244, 162, 97, 0.55);
}

.loop__center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.loop__center-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--c-navy);
  opacity: 0.4;
  font-weight: 500;
}

.loop__center-word {
  font-size: 32px;
  color: var(--c-orange);
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.8px;
  line-height: 1.1;
  margin-top: 4px;
}

.loop__node {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: var(--c-cream);
  border: 1.5px solid var(--c-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-navy);
  font-size: 14px;
  font-weight: 500;
  font-style: italic;
  z-index: 2;
}

.loop__node--target {
  background: var(--c-orange);
  border-color: var(--c-orange);
}

.loop__label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  font-size: 18px;
  color: var(--c-navy);
  font-weight: 500;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.loop__label--target {
  color: var(--c-orange);
  font-weight: 700;
  font-style: italic;
}


/* ============ THE STACK MARQUEES ============ */
.stack { padding: 48px 0; }

.stack__header {
  padding: 0 48px 40px;
}

.stack__header .eyebrow {
  display: block;
  margin-bottom: 12px;
}

.stack__marquee {
  overflow: hidden;
  margin-bottom: 18px;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.stack__marquee:last-child { margin-bottom: 0; }

.stack__track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  align-items: center;
}

@keyframes stack-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes stack-right {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.stack__track--left { animation: stack-left 70s linear infinite; }
.stack__track--right { animation: stack-right 80s linear infinite; }

.stack__item {
  font-size: 42px;
  line-height: 1;
  color: var(--c-navy);
  font-weight: 400;
  letter-spacing: -1.5px;
  padding: 0 28px;
  flex-shrink: 0;
}

.stack__dot {
  color: var(--c-orange);
  font-size: 42px;
  line-height: 1;
  flex-shrink: 0;
}


/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  /* LOOP — vertical timeline on mobile with animated traveling dot */
  /* HTML order of .loop children:
     1: .loop__ring
     2: .loop__orbit (contains .loop__dot)
     3: .loop__center
     4-5: node1 + label1
     6-7: node2 + label2
     8-9: node3 + label3
     10-11: node4 + label4
     12-13: node5 + label5 */
  .loop {
    height: auto;
    max-width: 100%;
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-areas:
      "center center"
      "n1 l1"
      "n2 l2"
      "n3 l3"
      "n4 l4"
      "n5 l5";
    gap: 24px 16px;
    padding: 8px 0;
    align-items: center;
    position: relative;
  }
  
  .loop__ring { display: none; }
  
  /* Center label at top — ALWAYS + on. on same line */
  .loop__center {
    position: static;
    transform: none;
    grid-area: center;
    text-align: left;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(25, 40, 65, 0.1);
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .loop__center-eyebrow { display: inline-block; }
  .loop__center-word { 
    display: inline-block; 
    font-size: 28px; 
    margin-top: 0;
    white-space: nowrap;
  }
  
  /* Vertical connector line behind circles */
  .loop::before {
    content: "";
    position: absolute;
    top: 100px;
    bottom: 24px;
    left: 23px;
    width: 1px;
    background: rgba(25, 40, 65, 0.15);
    z-index: 0;
  }
  
  /* Reset inline transforms — they were used for circular positioning */
  .loop__node {
    position: static;
    transform: none !important;
    margin: 0 !important;
    width: 48px;
    height: 48px;
    z-index: 2;
    background: var(--c-cream);
  }
  /* HTML children indices: nodes are at positions 4, 6, 8, 10, 12 */
  .loop__node:nth-child(4)  { grid-area: n1; }
  .loop__node:nth-child(6)  { grid-area: n2; }
  .loop__node:nth-child(8)  { grid-area: n3; }
  .loop__node:nth-child(10) { grid-area: n4; }
  .loop__node:nth-child(12) { grid-area: n5; }
  
  .loop__label {
    position: static;
    transform: none !important;
    margin: 0 !important;
    text-align: left;
    font-size: 18px;
    white-space: normal;
  }
  /* HTML children indices: labels are at positions 5, 7, 9, 11, 13 */
  .loop__label:nth-child(5)  { grid-area: l1; }
  .loop__label:nth-child(7)  { grid-area: l2; }
  .loop__label:nth-child(9)  { grid-area: l3; }
  .loop__label:nth-child(11) { grid-area: l4; }
  .loop__label:nth-child(13) { grid-area: l5; }
  
  .loop__label--target { font-size: 22px; }
  
  /* Animated orange dot — sits BEHIND the circles */
  .loop__orbit {
    display: block;
    position: absolute;
    top: 100px;
    bottom: 24px;
    left: 23px;
    right: auto;
    width: 1px;
    height: auto;
    transform: none !important;
    animation: none !important;
    z-index: 0;
    transform-origin: initial;
  }
  
  /* Override desktop .loop__dot styles entirely */
  .loop .loop__dot {
    position: absolute;
    top: 0;
    left: -6px;
    transform: none;
    width: 13px;
    height: 13px;
    animation: loop-vertical-mobile 12s linear infinite;
  }
  
  @keyframes loop-vertical-mobile {
    0%   { top: 0; opacity: 1; }
    90%  { top: calc(100% - 13px); opacity: 1; }
    95%  { top: calc(100% - 13px); opacity: 0; }
    96%  { top: 0; opacity: 0; }
    100% { top: 0; opacity: 1; }
  }
  
  /* STACK MARQUEES */
  .stack__item, .stack__dot { font-size: 26px; padding: 0 16px; }
  .stack__header { padding: 0 20px 28px; }
  
  /* HEADINGS */
  .h1-big { font-size: 44px; letter-spacing: -1.8px; }
  .h2-medium { font-size: 32px; letter-spacing: -1.2px; }
  .body-large { font-size: 24px; letter-spacing: -0.8px; }
  .section { padding: 32px 20px; }
  
  /* CASES — Use Grid template-areas to explicitly place each cell as one unified block per case */
  .cases {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "e1"
      "n1"
      "t1"
      "r1"
      "gap1"
      "e2"
      "n2"
      "t2"
      "r2"
      "gap2"
      "e3"
      "n3"
      "t3"
      "r3";
    grid-template-rows:
      auto auto auto auto
      24px
      auto auto auto auto
      24px
      auto auto auto auto;
    gap: 0;
    position: static;
    background: transparent;
  }
  .cases__bg { display: none !important; }
  
  .cases__cell {
    background: var(--c-cream-dark);
    padding-left: 20px;
    padding-right: 20px;
    position: static;
    margin: 0;
  }
  
  .cases__cell--eyebrow:nth-child(2) { grid-area: e1; border-radius: 4px 4px 0 0; }
  .cases__cell--eyebrow:nth-child(3) { grid-area: e2; border-radius: 4px 4px 0 0; }
  .cases__cell--eyebrow:nth-child(4) { grid-area: e3; border-radius: 4px 4px 0 0; }
  .cases__cell--name:nth-child(5)    { grid-area: n1; }
  .cases__cell--name:nth-child(6)    { grid-area: n2; }
  .cases__cell--name:nth-child(7)    { grid-area: n3; }
  .cases__cell--tag:nth-child(8)     { grid-area: t1; }
  .cases__cell--tag:nth-child(9)     { grid-area: t2; }
  .cases__cell--tag:nth-child(10)    { grid-area: t3; }
  .cases__cell--result:nth-child(11) { grid-area: r1; border-radius: 0 0 4px 4px; }
  .cases__cell--result:nth-child(12) { grid-area: r2; border-radius: 0 0 4px 4px; }
  .cases__cell--result:nth-child(13) { grid-area: r3; border-radius: 0 0 4px 4px; }
  
  .cases__cell--eyebrow { 
    padding-top: 24px; 
    padding-bottom: 12px; 
    border-radius: 4px 4px 0 0;
    opacity: 1;
    color: rgba(25, 40, 65, 0.5);
  }
  .cases__cell--name { 
    padding-top: 0; 
    padding-bottom: 8px; 
    font-size: 26px;
    border-radius: 0;
    opacity: 1;
  }
  .cases__cell--tag { 
    padding-top: 0; 
    padding-bottom: 16px;
    border-radius: 0;
    opacity: 1;
    color: rgba(25, 40, 65, 0.55);
  }
  .cases__cell--result { 
    padding-top: 0; 
    padding-bottom: 24px; 
    font-size: 18px; 
    margin-bottom: 0; 
    border-radius: 0 0 4px 4px;
    opacity: 1;
  }
}
