/* Services: auto-advancing tabs on the right drive mock screens on the left. */
.studio {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(1.25rem, 4vw, 4rem);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
}

.stage {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: var(--radius-lg);
  background: var(--holo);
  background-size: 160% 160%;
  animation: holo-shift 9s ease-in-out infinite alternate;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 7%;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transition: opacity 500ms ease, transform 700ms var(--ease);
}

.screen.is-active { opacity: 1; transform: none; }
.screen h3 { margin: 0 0 0.75rem; font-size: 0.85rem; font-weight: 500; color: var(--color-muted); }

/* Marketing screen */
.channel {
  display: grid;
  grid-template-columns: 6rem 1fr 3.2rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-line);
  font-size: 0.85rem;
}

.channel b { font: 500 0.8rem / 1 var(--font-mono); text-align: right; }

.meter { height: 8px; border-radius: 99px; background: var(--color-surface); overflow: hidden; }

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--holo);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1200ms var(--ease) 200ms;
}

.screen.is-active .meter i { transform: scaleX(var(--v)); }

.spark { flex: 1; min-height: 40px; width: 100%; margin-top: 0.75rem; }

.spark path {
  fill: none;
  stroke: var(--color-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1600ms var(--ease) 300ms;
}

.screen.is-active .spark path { stroke-dashoffset: 0; }

.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.kpis div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  background: var(--color-surface);
}

.kpis span { font-size: 0.7rem; line-height: 1.25; color: var(--color-muted); }
/* Values sit on a shared baseline even when labels wrap to two lines. */
.kpis b { margin-top: auto; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.03em; }

/* Software screen */
.browser-bar { display: flex; align-items: center; gap: 6px; margin: -0.4rem 0 1rem; }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--color-surface-2); }

.browser-bar span {
  flex: 1;
  margin-left: 0.6rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--color-surface);
  font: 400 0.7rem / 1.4 var(--font-mono);
  color: var(--color-muted);
}

.shop-hero {
  flex: 0 0 30%;
  display: flex;
  align-items: flex-end;
  padding: 0.9rem;
  border-radius: 10px;
  background: var(--color-code-bg);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 0.7rem; }
.shop-grid div { aspect-ratio: 1; border-radius: 10px; background: var(--holo-soft); }
.shop-grid div:nth-child(2) { background: var(--color-surface-2); }

.code-pop {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 58%;
  padding: 0.8rem;
  border-radius: 10px;
  background: var(--color-code-bg);
  color: #d8d8dc;
  font: 400 0.68rem / 1.65 var(--font-mono);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 700ms var(--ease) 350ms, opacity 500ms ease 350ms;
}

.screen.is-active .code-pop { transform: none; opacity: 1; }

/* Together screen */
.flow { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }

.flow-node {
  position: relative;
  z-index: 1;
  padding: 0.9rem 0.6rem;
  border-radius: 12px;
  background: var(--color-surface);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
}

.flow-node svg { width: 22px; height: 22px; margin: 0 auto 0.4rem; }
.flow-line { position: absolute; top: 50%; left: 12%; right: 12%; height: 2px; background: var(--color-surface-2); }

.flow-line i {
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-danube);
  animation: travel 2.6s linear infinite;
}

.flow-line i:nth-child(2) { animation-delay: 0.9s; background: #9fd400; }
.flow-line i:nth-child(3) { animation-delay: 1.7s; }

@keyframes travel {
  from { left: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  to { left: 100%; opacity: 0; }
}

.report {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: auto;
  padding: 1rem;
  border: 1px dashed #d6d6da;
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.report b { font-size: 1.6rem; font-weight: 600; color: var(--color-ink); letter-spacing: -0.04em; }

/* ---------- Copy + tabs ---------- */
.studio-copy h2 {
  margin: 0 0 2rem;
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.tabs { display: grid; gap: 0.35rem; }

.tab {
  position: relative;
  width: 100%;
  padding: 1rem 1.1rem;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 200ms ease;
}

.tab:hover { background: rgba(0, 0, 0, 0.03); }
.tab[aria-expanded="true"] { background: var(--color-surface-2); }
.tab-title { display: block; font-weight: 500; font-size: 1.05rem; }

.tab-desc {
  display: grid;
  grid-template-rows: 0fr;
  color: var(--color-body);
  font-size: 0.95rem;
  transition: grid-template-rows 450ms var(--ease);
}

.tab-desc > span { overflow: hidden; }
.tab[aria-expanded="true"] .tab-desc { grid-template-rows: 1fr; }
.tab[aria-expanded="true"] .tab-desc > span { padding-top: 0.4rem; }

.tab-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--color-ink);
  transform-origin: left;
  transform: scaleX(0);
}

.tab[aria-expanded="true"] .tab-progress { animation: progress var(--tab-ms, 6500ms) linear forwards; }
.studio.is-paused .tab-progress { animation-play-state: paused; }

@keyframes progress { to { transform: scaleX(1); } }

.studio-copy .btn { margin-top: 1.75rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .studio { grid-template-columns: 1fr; }
  .stage { aspect-ratio: 4 / 3; }
}

@media (max-width: 560px) {
  .studio { border-radius: var(--radius-lg); }
  .stage { aspect-ratio: auto; height: 430px; }
  .screen { inset: 5%; padding: 1rem; }
  .channel { grid-template-columns: 4.6rem 1fr 2.8rem; gap: 0.5rem; font-size: 0.78rem; }
  .kpis b { font-size: 0.9rem; }
  .code-pop { width: 78%; }
}
