/* Overlay conversation (/design/overlay/): the hero text on top, then the whole solarpunk plant
   picture, never cropped, with the team questions told on scroll in a Claude window.
   Below 960px the window sits under the picture and overlaps its bottom edge; from 960px the
   picture is big enough to hold the window inside it. */

.ov-hero { display: grid; justify-items: start; padding-top: clamp(32px, 5vw, 72px) !important; }
.ov-hero .vlead { max-width: 52ch; }
.ov-title, .ov-lede { min-width: 0; }

/* Desktop: the intro paragraphs anchor to the right, level with the foot of the title. */
@media (min-width: 960px) {
  .ov-hero {
    grid-template-columns: minmax(0, 1fr) clamp(300px, 34vw, 440px);
    column-gap: clamp(40px, 5vw, 80px);
    align-items: end;
  }
  .ov-title { container-type: inline-size; justify-self: stretch; }
  /* The longest line is about 10.5em in this font, so the size follows the column and the headline stays three lines. */
  .vpage.ov-page .ov-title h1:has(.l) { font-size: min(3.6rem, 100cqi / 10.5); }
  .ov-lede { justify-self: end; }
  .ov-lede .vlead:first-child { margin-top: 0; }
  .ov-lede .vlead:last-child { margin-bottom: 0.15em; }
  .ov-hero .hero-actions { grid-column: 1 / -1; }
}

.ov-scroll { --ov-gutter: clamp(20px, 5vw, 64px); --ov-ratio: 1672 / 941; margin-top: clamp(32px, 5vw, 56px); }

/* Phones: the picture runs edge to edge at its own shape, the window overlaps its foot. */
.ov-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-inline: calc(-1 * var(--ov-gutter));
}
.ov-bg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ov-ratio);
}

.ov-tabs { display: none; }
.ov-step {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  margin: 0;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--theme-surface-raised);
  border: 1px solid var(--theme-line);
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}
.ov-step b { font-weight: 500; }
.ov-step span { color: var(--theme-ink-muted); font-variant-numeric: tabular-nums; }
.ov-scroll:not(.js) .ov-step { display: none; }

.ov-cd {
  display: flex;
  flex-direction: column;
  width: calc(100% - 24px);
  max-width: 880px;
  margin-top: -56px;
}
.ov-cd .cd-main { flex: 1; min-height: 0; }
.ov-cd .cd-bar .tl { display: block; }
.ov-cd .cd-brand { margin-left: 6px; }
.ov-cd .cd-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.ov-cd .cd-tool { flex-wrap: nowrap; align-items: flex-start; }
.ov-cd .cd-tool > img { margin-top: 2px; }
.ov-chat { display: block; min-height: 0; overflow: hidden; }
.ov-track { position: relative; display: grid; gap: 32px; }
.ov-cd .ex.ov-later { display: none; }

/* With JS the stage pins under the sticky header and the page scrolls through it. */
.ov-scroll.js:not(.ov-static) { height: calc(100svh + var(--ov-n, 6) * 80svh); }
.ov-scroll.js .ov-stage {
  display: flex;
  flex-direction: column;
  height: calc(100svh - var(--ov-top, 0px));
  padding-bottom: 16px;
}
.ov-scroll.js:not(.ov-static) .ov-stage { position: sticky; top: var(--ov-top, 0px); }
.ov-scroll.ov-static .ov-stage { height: min(820px, 92svh); }
.ov-scroll.js .ov-frame { flex: 1; min-height: 0; }
.ov-scroll.js .ov-cd { flex: 1; min-height: 0; }
.ov-scroll.js .ov-chat { flex: 1; }
.ov-scroll.js:not(.ov-static) .ov-track { transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1); }

@media (min-width: 768px) {
  .ov-frame { margin-inline: 0; }
  .ov-bg { border-radius: 24px; }
  .ov-cd { width: calc(100% - 64px); margin-top: -80px; }
  .ov-step, .ov-scroll.js .ov-step { display: none; }
  .ov-scroll.js .ov-tabs {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    width: min(calc(100% - 48px), 460px);
    padding-bottom: 5px;
  }
  .ov-tabs button {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--chip-face, var(--theme-surface-raised));
    border: 1px solid var(--chip-outline, var(--theme-line));
    color: var(--ink);
    font: 500 14px/1 var(--font-body);
    cursor: pointer;
    box-shadow: 0 5px 0 var(--chip-edge, var(--theme-surface-raised-strong));
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.15s ease, color 0.15s ease;
  }
  .ov-tabs button:hover { transform: translateY(-1px); box-shadow: 0 6px 0 var(--chip-edge, var(--theme-surface-raised-strong)); background: var(--chip-hover, var(--theme-surface-raised-strong)); }
  .ov-tabs button[aria-pressed="true"] {
    background: var(--hl-strong);
    border-color: var(--palette-holly-700);
    color: var(--hl-ink);
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--palette-holly-700), inset 0 2px 5px rgba(0, 0, 0, 0.28);
  }
  .ov-tabs button:focus-visible { outline: 2px solid var(--hl); outline-offset: 3px; }
}

/* Desktop: the whole picture is the frame, sized to fit the screen, and the window sits inside it. */
@media (min-width: 960px) {
  .ov-frame {
    flex: none !important;
    align-self: center;
    width: min(100%, calc((100svh - var(--ov-top, 0px) - 28px) * var(--ov-ratio)));
    aspect-ratio: var(--ov-ratio);
    gap: 20px;
    padding: 20px clamp(24px, 4vw, 56px) 0;
    border-radius: 28px;
    overflow: hidden;
    isolation: isolate;
  }
  .ov-scroll.js .ov-stage { padding: 12px 0 16px; }
  .ov-bg { position: absolute; inset: 0; z-index: -1; height: 100%; border-radius: 0; }
  .ov-scroll.js .ov-tabs {
    position: static;
    transform: none;
    grid-template-columns: repeat(4, auto);
    justify-content: center;
    width: auto;
  }
  .ov-cd { width: 100%; margin-top: 0; border-bottom: 0; border-radius: 14px 14px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ov-tabs button, .ov-scroll.js .ov-track { transition: none !important; }
}
