/* docs/components/hero-device-launcher/hero-device-launcher.css */

/* Keep your existing .hdl positioning logic */
.hdl{
  width: 100%;
  max-width: 860px;
  margin: 0.35rem auto 0.75rem;
  position: relative;
  transform: translateX(-112px);
}

/* Panel shell (dark charcoal) */
.hdl-panel{
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 46px rgba(0,0,0,0.42);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(10px);

  /* Flex column so the GIF area fills remaining space */
  display: flex;
  flex-direction: column;

  /* collapsed by default */
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);

  transition:
    max-height 260ms ease,
    opacity 200ms ease,
    transform 260ms ease;

  /* Scroll-margin so scrollIntoView clears the fixed header */
  scroll-margin-top: calc(var(--header-h, 70px) + var(--cohort-banner-offset, 0px));
}

/* Expanded state: fill viewport from header bottom to viewport bottom */
.hdl.is-open .hdl-panel,
.hdl:focus-within .hdl-panel{
  max-height: calc(100vh - var(--header-h, 70px) - var(--cohort-banner-offset, 0px));
  max-height: calc(100dvh - var(--header-h, 70px) - var(--cohort-banner-offset, 0px));
  opacity: 1;
  transform: translateY(0);
}

/* --- CTA block (Claude-like) — fixed height, doesn't flex --- */
.hdl-cta{
  flex: 0 0 auto;
  padding: 12px 14px 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.hdl-cta-row{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.hdl-cta-title{
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.01em;
  color: rgba(226, 232, 240, 0.92);
}

/* command pill */
.hdl-cta-pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(148, 163, 184, 0.16);

  max-width: 100%;
}

.hdl-cta-code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 850;
  color: rgba(226, 232, 240, 0.95);

  max-width: 440px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hdl-cta-copy{
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255,255,255,0.06);
  color: rgba(226, 232, 240, 0.95);

  border-radius: 12px;
  padding: 7px 10px;

  font-weight: 950;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;

  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.hdl-cta-copy:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.10);
  border-color: rgba(90,155,212,0.55);
  box-shadow: 0 14px 26px rgba(0,0,0,0.35);
}

.hdl-cta-copy:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(90,155,212,0.35);
}

.hdl-cta-docs{
  margin: 8px auto 0;
  display: block;
  text-align: center;

  font-size: 12px;
  font-weight: 850;
  color: rgba(226,232,240,0.70);
  text-decoration: none;
}

.hdl-cta-cohort-link{
  color: #5A9BD4;
  text-decoration: underline;
  text-decoration-color: rgba(90,155,212,0.4);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.hdl-cta-cohort-link:hover{
  color: #7AB4E8;
  text-decoration-color: rgba(90,155,212,0.7);
}

/* --- Demo GIF area — flexes to fill all remaining panel height --- */
.hdl-demo{
  position: relative;
  padding: 8px 14px 10px;

  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.hdl-demo-placeholder{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 280px;
  border-radius: 10px;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(148, 163, 184, 0.14);
  cursor: pointer;
}

.hdl-demo-play{
  font-size: 13px;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.88);
  letter-spacing: 0.02em;
}

.hdl-demo-gif{
  display: none;
  width: 100%;
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
}

.hdl-demo.is-loaded .hdl-demo-placeholder{
  display: none;
}

.hdl-demo.is-loaded .hdl-demo-gif{
  display: block;
}

/* SVG demos need cover to fill the panel nicely */
.hdl-demo-gif[src$=".svg"]{
  object-fit: cover;
}

/* ── Mobile: fill width with breathing room on sides ── */
@media (max-width: 920px){
  .hdl{
    transform: none;
  }
}

@media (max-width: 720px){
  .hdl{
    max-width: calc(100% - 24px);
    margin-left: 12px;
    margin-right: 12px;
  }
  .hdl-cta-code{ max-width: 360px; }
}

@media (max-width: 520px){
  .hdl{
    max-width: calc(100% - 16px);
    margin-left: 8px;
    margin-right: 8px;
  }
  .hdl-cta{ padding-left: 12px; padding-right: 12px; }
  .hdl-cta-row{ justify-content: center; }
  .hdl-cta-code{ max-width: 260px; }
}
