/* Homepage "What we do" stage: a live preview panel on the left, a rail of
   service tabs on the right. Hover or focus a service to stage it. */

.stage-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  align-items: stretch;
}

/* Stage (left) */
.stage {
  position: relative;
  border-radius: 24px;
  background: var(--grad-stage);
  border: 1px solid rgba(11, 29, 15, 0.06);
  overflow: hidden;
  min-height: 480px;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 12% 118%, var(--pistachio-30), transparent 55%);
  pointer-events: none;
}
.stage__inner { display: grid; height: 100%; }

.panel {
  grid-area: 1 / 1;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 3.4vw, 44px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.42s var(--ease), transform 0.42s var(--ease), visibility 0s linear 0.42s;
  pointer-events: none;
}
.panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.42s var(--ease), transform 0.5s var(--ease-out), visibility 0s;
  pointer-events: auto;
}

.panel__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--deep-forest);
  margin-bottom: 10px;
}
.panel__desc {
  font-size: 1.02rem;
  color: var(--charcoal-58);
  max-width: 34ch;
}
.panel__visual {
  flex: 1;
  min-height: 220px;
  margin: 26px 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.panel__link {
  align-self: flex-start;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green-deep);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.panel__link .arw { transition: transform 0.2s var(--ease-out); }
.panel__link:hover .arw { transform: translateX(4px); }

/* Rail (right) */
.rail { display: flex; flex-direction: column; gap: 16px; }
.svc {
  position: relative;
  text-align: left;
  background: #FFFFFF;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 22px 24px 22px 26px;
  cursor: pointer;
  font-family: var(--font-body);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out),
              box-shadow 0.25s var(--ease-out), transform 0.2s var(--ease-out);
}
.svc::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: var(--pistachio);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.28s var(--ease-out);
}
.svc__name {
  font-weight: 700;
  font-size: 1.06rem;
  color: var(--warm-charcoal);
  transition: color 0.2s var(--ease-out);
}
.svc__blurb {
  font-size: 0.9rem;
  color: var(--charcoal-58);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease-out), opacity 0.25s var(--ease-out), margin 0.3s var(--ease-out);
}
.svc.is-active {
  background: linear-gradient(135deg, #F2F7EB, #EAF2DE);
  border-color: rgba(150, 201, 106, 0.55);
}
.svc.is-active::before { transform: scaleY(1); }
.svc.is-active .svc__name { color: var(--deep-forest); }
.svc.is-active .svc__blurb { max-height: 60px; opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  .svc:hover { transform: translateX(2px); box-shadow: 0 6px 22px rgba(11, 29, 15, 0.06); }
}
.svc:focus-visible { outline: 2px solid var(--deep-forest); outline-offset: 3px; }

.stage-hint { font-size: 0.8rem; color: var(--charcoal-58); margin: 14px 2px 0; }

/* Visual: web design device */
.device {
  width: 100%;
  max-width: 440px;
  background: var(--deep-forest);
  border-radius: 14px;
  box-shadow: 0 24px 50px -18px rgba(11, 29, 15, 0.55);
  overflow: hidden;
}
.device__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  background: var(--green-shadow);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.device__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.device__url { margin-left: 8px; flex: 1; height: 18px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); }
.device__body { padding: 16px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.tile { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 14px; }
.tile--hero { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 9px; }
.bar-line { height: 9px; border-radius: 5px; background: rgba(255, 255, 255, 0.14); }
.bar-line.w70 { width: 70%; }
.bar-line.w45 { width: 45%; }
.cta-chip { width: 96px; height: 26px; border-radius: 7px; background: var(--pistachio); margin-top: 4px; }
.kpi { font-family: var(--font-display); font-size: 1.9rem; color: #fff; line-height: 1; }
.kpi small, .tile__label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 6px;
  letter-spacing: 0.02em;
}
.spark { display: flex; align-items: flex-end; gap: 5px; height: 44px; margin-top: 4px; }
.spark span { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #5EC8C0, #2C8F9E); }

/* Visual: SEO SERP theater */
.serp { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.serp__search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  box-shadow: 0 8px 22px -14px rgba(11, 29, 15, 0.25);
  font-size: 0.9rem;
  color: var(--charcoal-80);
}
.serp__search .mag { width: 15px; height: 15px; border: 2px solid #9AA093; border-radius: 50%; position: relative; flex: none; }
.serp__search .mag::after { content: ""; position: absolute; width: 6px; height: 2px; background: #9AA093; transform: rotate(45deg); right: -4px; bottom: 0; }
.serp__pack { background: #fff; border: 1px solid var(--hairline); border-radius: 14px; padding: 8px; box-shadow: 0 10px 26px -16px rgba(11, 29, 15, 0.3); }
.serp__label { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: #8A8F83; padding: 6px 8px 8px; }
.result { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 9px; }
.result--top { background: linear-gradient(135deg, #F1F7E9, #E7F1DA); border: 1px solid rgba(150, 201, 106, 0.5); }
.result__pin {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--pistachio);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--deep-forest);
  font-weight: 700;
  font-size: 0.8rem;
}
.result--dim .result__pin { background: #E7E9E2; color: #9AA093; }
.result__lines { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.result__lines b { height: 8px; border-radius: 4px; background: var(--charcoal-80); display: block; }
.result--dim .result__lines b { background: #C7CABF; }
.result__lines s { height: 6px; border-radius: 3px; background: #CDD0C6; display: block; text-decoration: none; }
.result__stars { font-size: 0.7rem; color: #E0A83C; letter-spacing: 1px; flex: none; }
.serp__chips { display: flex; gap: 8px; }
.serp-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid var(--hairline);
  color: var(--warm-charcoal);
}
.serp-chip--win { background: var(--deep-forest); color: #fff; border-color: var(--deep-forest); }

/* Visual: content editorial preview */
.article {
  width: 100%;
  max-width: 430px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 26px 28px;
  box-shadow: 0 14px 34px -20px rgba(11, 29, 15, 0.3);
}
.article__tag { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-deep); font-weight: 700; }
.article__head {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.7rem;
  line-height: 1.12;
  color: var(--deep-forest);
  margin: 12px 0 16px;
}
.type-caret { display: inline-block; width: 2px; height: 1.2em; background: var(--pistachio); vertical-align: -0.18em; margin-left: 2px; }
.article__body span { display: block; height: 8px; border-radius: 4px; background: #E3E5DD; margin: 9px 0; }
.article__body span.w90 { width: 90%; }
.article__body span.w95 { width: 95%; }
.article__body span.w60 { width: 60%; }
.article__meta { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.pill-done {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--deep-forest);
  background: #EAF2DE;
  border: 1px solid rgba(150, 201, 106, 0.5);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
}
.article__meta small { color: var(--charcoal-58); font-size: 0.8rem; }

/* Visual: video frame + scrubber */
.video { width: 100%; max-width: 440px; }
.video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(120% 120% at 30% 20%, #20402A, var(--deep-forest));
  box-shadow: 0 24px 50px -20px rgba(11, 29, 15, 0.55);
}
.video__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.video__play::after { content: ""; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; margin-left: 3px; }
.shape { position: absolute; border-radius: 50%; }
.shape--a { width: 60px; height: 60px; background: rgba(150, 201, 106, 0.35); top: 16px; left: 18px; filter: blur(1px); }
.shape--b { width: 34px; height: 34px; border: 2px solid rgba(150, 201, 106, 0.6); bottom: 34px; right: 26px; }
.lower-third { position: absolute; left: 16px; bottom: 16px; height: 16px; width: 120px; border-radius: 5px; background: var(--pistachio); }
.lower-third::after { content: ""; position: absolute; left: 0; bottom: -9px; height: 6px; width: 70px; border-radius: 4px; background: rgba(255, 255, 255, 0.5); }
.scrubber { margin-top: 12px; height: 6px; border-radius: 6px; background: rgba(11, 29, 15, 0.12); position: relative; overflow: visible; }
.scrubber__fill { position: absolute; inset: 0 auto 0 0; width: 38%; background: var(--deep-forest); border-radius: 6px; }
.scrubber__head {
  position: absolute;
  top: 50%;
  left: 38%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--deep-forest);
  transform: translate(-50%, -50%);
}

/* Ambient motion, active panel only */
.panel.is-active .spark span { transform-origin: bottom; animation: stage-grow 0.7s var(--ease-out) both; }
.panel.is-active .spark span:nth-child(1) { height: 40%; animation-delay: 0.05s; }
.panel.is-active .spark span:nth-child(2) { height: 62%; animation-delay: 0.12s; }
.panel.is-active .spark span:nth-child(3) { height: 48%; animation-delay: 0.19s; }
.panel.is-active .spark span:nth-child(4) { height: 82%; animation-delay: 0.26s; }
.panel.is-active .spark span:nth-child(5) { height: 66%; animation-delay: 0.33s; }
@keyframes stage-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.panel.is-active .type-caret { animation: stage-blink 1.05s steps(1) infinite; }
@keyframes stage-blink { 50% { opacity: 0; } }

.panel.is-active .scrubber__fill { animation: stage-sweep-w 4.5s var(--ease) infinite alternate; }
.panel.is-active .scrubber__head { animation: stage-sweep-l 4.5s var(--ease) infinite alternate; }
@keyframes stage-sweep-w { from { width: 14%; } to { width: 82%; } }
@keyframes stage-sweep-l { from { left: 14%; } to { left: 82%; } }
.panel.is-active .shape--b { animation: stage-float 3.4s ease-in-out infinite alternate; }
@keyframes stage-float { to { transform: translateY(-8px); } }

@media (max-width: 820px) {
  .stage-grid { grid-template-columns: 1fr; }
  .rail { order: -1; }
  .stage { min-height: 440px; }
  .svc { flex: none; }
  .svc__blurb { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stage * { animation: none !important; }
  .panel, .panel.is-active { transition: opacity 0.2s linear, visibility 0s; transform: none; }
}
