/* Live Website Preview — shared case-study module.
   Themed by the host page's tokens (--ink, --ink-soft, --line, --cream, --accent,
   --caption, --ease), so each case study picks up its own palette. */

.case-preview { display: grid; gap: clamp(20px, 2.4vw, 32px); }

.case-preview-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 17.5vw, 262px);
  align-items: end;
  gap: clamp(22px, 3vw, 46px);
}

.case-preview-col { display: grid; gap: 14px; min-width: 0; margin: 0; }

.case-preview-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #fff;
}

.case-preview-desk .case-preview-frame {
  border: 1px solid var(--line, rgba(17, 26, 65, .12));
  border-radius: 0 0 20px 20px;
  border-top: 0;
  aspect-ratio: 16 / 10;
}

.case-preview-chrome {
  display: grid;
  grid-template-columns: repeat(3, 8px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line, rgba(17, 26, 65, .12));
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: #f6f6f8;
}

.case-preview-chrome > i { width: 8px; height: 8px; border-radius: 50%; background: #c6c8cf; }

.case-preview-url {
  overflow: hidden;
  min-width: 0;
  color: #43485c;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.005em;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-preview-url:hover { color: var(--accent, #0071e3); text-decoration: underline; }

.case-preview-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #43485c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.case-preview-status::before { width: 6px; height: 6px; border-radius: 50%; background: #34c759; content: ""; }
.case-preview-status.is-preview::before { background: #f0a32b; }

.case-preview-phone {
  position: relative;
  width: 100%;
  padding: 11px;
  border-radius: 46px;
  background: #0f1113;
  box-shadow: 0 24px 60px rgba(9, 14, 32, .22);
}

.case-preview-phone .case-preview-frame { border-radius: 36px; aspect-ratio: 390 / 780; }

/* Absolutely positioned so the 1440px / 390px render width never widens the
   layout; the module scales it to the frame instead. */
.case-preview-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  border: 0;
  transform-origin: 0 0;
}

/* The page keeps its own scrolling until a frame is activated. */
.case-preview-frame iframe[data-inert="true"] { pointer-events: none; }

.case-preview-enter {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: rgba(12, 18, 24, .04);
  color: var(--ink, #1d1d1f);
  cursor: pointer;
  font: inherit;
}

.case-preview-enter span {
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 30px rgba(9, 14, 32, .18);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.case-preview-enter:hover span { background: #fff; }
.case-preview-enter[hidden] { display: none; }

.case-preview-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  color: var(--caption, #5e6577);
  font-size: 14px;
  letter-spacing: -.01em;
  line-height: 1.5;
}

.case-preview-caption b { color: var(--ink, #1d1d1f); font-weight: 650; }

.case-preview-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  color: var(--caption, #5e6577);
  font-size: 13px;
  letter-spacing: -.005em;
}

.case-preview-note a { color: var(--accent, #0071e3); font-weight: 650; text-decoration: none; }
.case-preview-note a:hover { text-decoration: underline; }

.case-preview-fallback {
  display: grid;
  place-content: center;
  gap: 12px;
  height: 100%;
  padding: 28px;
  background: var(--cream, #f5f5f7);
  text-align: center;
}

.case-preview-fallback p { margin: 0; color: var(--ink-soft, #4d626c); font-size: 14px; line-height: 1.5; }
.case-preview-fallback a { color: var(--accent, #0071e3); font-weight: 650; }

@media (max-width: 900px) {
  .case-preview-stage { grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 6vw, 44px); }
  .case-preview-phonecol { justify-self: center; width: min(320px, 100%); }
}

@media (max-width: 640px) {
  .case-preview-chrome { grid-template-columns: repeat(3, 7px) minmax(0, 1fr); height: 36px; padding: 0 12px; }
  .case-preview-status { display: none; }
  .case-preview-desk .case-preview-frame { border-radius: 0 0 14px 14px; }
  .case-preview-caption { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .case-preview-enter, .case-preview-enter span { transition: none; }
}
