/* Hero, desk builder chat and the layout around "Your EZPZ desk" (Agent E). Tokens and
   shared classes come from landing.css; everything here is lp-hero-*, lp-build-*
   or lp-ob-*. Layout dimensions (avatar sizes, the thread's height floor and cap,
   1px borders) are the only literal sizes. Nothing moves by itself for more than
   a few seconds.
   The hero (_hero.html) is the headline and the live desk; the builder section
   (_builder.html, #build) right under it holds the chat and the desk preview.
   The desk preview is the shared personalize component (personalize/desk.css);
   only the grid around it is here. */

/* ── Hero layout ─────────────────────────────────────────────────────── */
.lp-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--lp-sp-8) var(--lp-sp-7);
  background: var(--lp-bg);
}
.lp-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 55% at 10% 6%, color-mix(in srgb, var(--lp-primary) 24%, transparent), transparent 70%),
    radial-gradient(48% 50% at 94% 34%, color-mix(in srgb, var(--lp-primary-2) 20%, transparent), transparent 70%);
}
.lp-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--lp-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--lp-border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .45;
  -webkit-mask-image: radial-gradient(70% 62% at 50% 28%, black, transparent 76%);
  mask-image: radial-gradient(70% 62% at 50% 28%, black, transparent 76%);
}
.lp-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--lp-sp-7);
  width: 100%;
}
.lp-hero-main,
.lp-hero-side { min-width: 0; }

/* From 1100px: headline left, live desk right, centred on each other. Nothing in
   the hero changes height after load, so centring never moves anything. */
@media (min-width: 1100px) {
  .lp-hero { padding-block: var(--lp-sp-8); }
  .lp-hero-grid {
    grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
    align-items: center;
    gap: 0 var(--lp-sp-7);
  }
  .lp-hero-main { grid-column: 1; }
  .lp-hero-side { grid-column: 2; }
  .lp-hero-title { font-size: clamp(40px, 4.2vw, 64px); }
  /* The right column rendered nothing: one centred column. */
  .lp-hero--solo .lp-hero-grid,
  .lp-hero-grid:not(:has(.lp-hero-side > *)) {
    grid-template-columns: minmax(0, 720px);
    justify-content: center;
  }
  .lp-hero--solo .lp-hero-main,
  .lp-hero-grid:not(:has(.lp-hero-side > *)) .lp-hero-main { grid-column: 1; }
}
.lp-hero--solo .lp-hero-side,
.lp-hero-side:not(:has(> *)) { display: none; }
/* Stacked, the mosaic (max 760px, centred by live.css) lines up with the text above it. */
@media (max-width: 1099.98px) {
  .lp-hero-side > .lp-live { margin-inline: 0; }
}

/* ── Headline ────────────────────────────────────────────────────────── */
.lp-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--lp-sp-2);
  margin: 0 0 var(--lp-sp-4);
  padding: var(--lp-sp-1) var(--lp-sp-3);
  border: 1px solid var(--lp-border-strong);
  border-radius: var(--lp-r-pill);
  background: var(--lp-surface-2);
  color: var(--lp-accent);
  font-size: var(--lp-fs-xs);
}
.lp-hero-dot {
  flex: none;
  width: var(--lp-sp-2);
  height: var(--lp-sp-2);
  border-radius: var(--lp-r-pill);
  background: var(--lp-primary);
}
.lp-hero-title {
  margin: 0 0 var(--lp-sp-5);
  font-family: var(--lp-font-title);
  font-size: var(--lp-fs-3xl);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.02em;
  text-wrap: balance;
  color: var(--lp-text);
  background: var(--lp-title-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lp-hero-lead {
  margin: 0 0 var(--lp-sp-6);
  max-width: 54ch;
  color: var(--lp-muted);
  font-size: var(--lp-fs-md);
  line-height: 1.55;
  text-wrap: pretty;
}
.lp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lp-sp-3);
}
.lp-hero-cta { border-radius: var(--lp-r-pill); }
.lp-hero-cta svg { flex: none; }
.lp-hero-note {
  margin: var(--lp-sp-4) 0 0;
  color: var(--lp-muted);
  font-size: var(--lp-fs-xs);
  line-height: 1.5;
}

/* ── Builder section (#build) ────────────────────────────────────────── */
/* It follows the hero directly, so it starts closer than a regular section. */
.lp-build {
  position: relative;
  isolation: isolate;
  padding-top: var(--lp-sp-7);
}
.lp-build::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(55% 45% at 50% 64%, color-mix(in srgb, var(--lp-primary) 10%, transparent), transparent 72%);
}
.lp-build-head { margin-bottom: var(--lp-sp-6); }

.lp-build-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--lp-sp-5);
}
/* Without JS the desk preview is hidden: the plain question sits alone, centred. */
html:not(.js) .lp-build-grid { max-width: 640px; margin-inline: auto; }

/* From 1100px: chat left, desk right, the same height. The row takes the taller
   of the two natural heights (the chat counts only a floor for its thread), and
   the chat thread fills whatever height the row has, scrolling inside it. The
   desk's screenshot pane takes any extra height on its side. */
@media (min-width: 1100px) {
  html.js .lp-build-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: stretch;
  }
  html.js .lp-build-grid .lp-ob-thread {
    flex: 1 1 0;
    min-height: 340px;
    max-height: none;
    contain: size;
  }
  html.js .lp-build-grid .lp-ob-composer { margin-top: auto; }
  /* The desk (personalize/desk.css) fills the row: its screenshot pane takes the
     extra height and its tool list scrolls inside its column if it runs longer. */
  html.js .lp-build-grid .lp-build-deskwrap {
    --ezd-body-align: stretch;
    --ezd-frame-grow: 1;
  }
}

/* ── Desk builder card ───────────────────────────────────────────────── */
.lp-ob {
  display: flex;
  flex-direction: column;
  gap: var(--lp-sp-3);
  min-width: 0;
  padding: var(--lp-sp-4) var(--lp-sp-5);
  border-color: var(--lp-border-strong);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--lp-primary) 8%, var(--lp-surface)) 0, var(--lp-surface) 140px);
  box-shadow: var(--lp-shadow), inset 0 1px 0 color-mix(in srgb, var(--lp-text) 5%, transparent);
}
/* A class-level display rule would otherwise beat the hidden attribute. */
.lp-ob [hidden] { display: none !important; }
/* Two presentations: plain links without JS, the chat and the desk preview with it. */
html:not(.js) .lp-ob-js { display: none !important; }
html.js .lp-ob-nojs { display: none !important; }

.lp-ob :focus-visible {
  outline: 2px solid var(--lp-accent);
  outline-offset: 2px;
}
.lp-ob h3[tabindex]:focus { outline: none; }

/* Header: EZPZ AI avatar, name, progress, Start over */
.lp-ob-head {
  display: flex;
  align-items: center;
  gap: var(--lp-sp-3);
  padding-bottom: var(--lp-sp-3);
  border-bottom: 1px solid var(--lp-border);
}
.lp-ob-orb,
.lp-ob-avatar {
  position: relative;
  flex: none;
  border-radius: var(--lp-r-pill);
  /* The EZPZ AI mark, the same round logo EZRA uses as its chat avatar. */
  background: #000 url("img/ezpz-ai.webp") center / cover no-repeat;
  box-shadow: 0 0 0 1px var(--lp-border-strong);
}
.lp-ob-orb {
  width: 40px;
  height: 40px;
  box-shadow: 0 0 0 1px var(--lp-border-strong), 0 6px 18px color-mix(in srgb, var(--lp-primary) 28%, transparent);
}
/* The ring: a conic sweep masked to a thin band. Static unless motion is allowed. */
.lp-ob-orb::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: conic-gradient(from 20deg, transparent 0turn, color-mix(in srgb, var(--lp-accent) 85%, transparent) .2turn, transparent .45turn, transparent 1turn);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), var(--lp-bg) calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), var(--lp-bg) calc(100% - 1px));
}
.lp-ob-avatar { width: 28px; height: 28px; }

.lp-ob-who { flex: 1; min-width: 0; }
.lp-ob-name {
  margin: 0;
  color: var(--lp-text);
  font-size: var(--lp-fs-sm);
  font-weight: 600;
  line-height: 1.3;
}
.lp-ob-subrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lp-sp-1) var(--lp-sp-3);
}
.lp-ob-sub {
  margin: 0;
  color: var(--lp-muted);
  font-size: var(--lp-fs-xs);
  line-height: 1.5;
}
.lp-ob-meter { display: inline-flex; gap: var(--lp-sp-1); }
.lp-ob-meter > span {
  width: 18px;
  height: 4px;
  border-radius: var(--lp-r-pill);
  background: var(--lp-surface-3);
}
.lp-ob-meter > span.is-on { background: color-mix(in srgb, var(--lp-primary) 50%, var(--lp-surface)); }
.lp-ob-meter > span.is-done { background: var(--lp-primary); }

.lp-ob-restart {
  flex: none;
  align-self: center;
  min-height: 32px;
  padding: var(--lp-sp-1) var(--lp-sp-2);
  border: 0;
  border-radius: var(--lp-r-sm);
  background: none;
  color: var(--lp-muted);
  font: inherit;
  font-size: var(--lp-fs-xs);
  text-decoration: underline;
  text-decoration-color: var(--lp-border-strong);
  text-underline-offset: 3px;
  cursor: pointer;
}
.lp-ob-restart:hover { color: var(--lp-text); }

/* No JS: the first question as links */
.lp-ob-nojs { display: flex; flex-direction: column; gap: var(--lp-sp-3); }
.lp-ob-nojs-q {
  margin: 0;
  font-size: var(--lp-fs-lg);
  font-weight: 600;
  color: var(--lp-text);
}
.lp-ob-nojs-note { margin: 0; color: var(--lp-muted); font-size: var(--lp-fs-sm); }
.lp-ob-nojs-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lp-sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ── Thread ──────────────────────────────────────────────────────────── */
/* Stacked, it grows with the conversation up to 460px, then scrolls inside the
   card; side by side it fills the card (see the builder layout above). The
   negative margin and padding keep focus rings inside the scroll box. */
.lp-ob-thread {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--lp-sp-3);
  max-height: 460px;
  margin-inline: calc(-1 * var(--lp-sp-2));
  padding: var(--lp-sp-1) var(--lp-sp-2) var(--lp-sp-2);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--lp-border-strong) transparent;
}
.lp-ob-thread.is-scrolled {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, var(--lp-bg) 28px);
  mask-image: linear-gradient(to bottom, transparent 0, var(--lp-bg) 28px);
}
.lp-ob-log {
  display: flex;
  flex-direction: column;
  gap: var(--lp-sp-3);
}
.lp-ob-log:empty { display: none; }

.lp-ob-msg {
  display: flex;
  align-items: flex-start;
  gap: var(--lp-sp-2);
  min-width: 0;
}
.lp-ob-msg--me { justify-content: flex-end; }
.lp-ob-bubble {
  min-width: 0;
  padding: var(--lp-sp-2) var(--lp-sp-3);
  border-radius: var(--lp-r);
  font-size: var(--lp-fs-sm);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.lp-ob-msg--ai .lp-ob-bubble {
  max-width: calc(100% - 24px - var(--lp-sp-2));
  border: 1px solid var(--lp-border);
  border-top-left-radius: var(--lp-sp-1);
  background: var(--lp-surface-2);
  color: var(--lp-text);
}
/* Visitor answers: a darkened primary-2 fill, so --lp-text on it stays above AA. */
.lp-ob-msg--me .lp-ob-bubble {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--lp-sp-2);
  max-width: 85%;
  border-bottom-right-radius: var(--lp-sp-1);
  background: var(--lp-primary-2);
  background: color-mix(in srgb, var(--lp-primary-2) 80%, var(--lp-bg));
  color: var(--lp-text);
}
.lp-ob-said { font-weight: 500; }
.lp-ob-edit {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 var(--lp-sp-1);
  border: 0;
  border-radius: var(--lp-sp-1);
  background: none;
  color: var(--lp-text);
  font: inherit;
  font-size: var(--lp-fs-xs);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--lp-text) 50%, transparent);
  text-underline-offset: 3px;
  cursor: pointer;
}
.lp-ob-edit:hover { text-decoration-color: var(--lp-text); }
.lp-ob .lp-ob-edit:focus-visible { outline-color: var(--lp-text); outline-offset: 1px; }

.lp-ob-say { margin: 0; font-weight: 500; }
.lp-ob-say-hint {
  margin: var(--lp-sp-1) 0 0;
  color: var(--lp-muted);
  font-size: var(--lp-fs-xs);
  line-height: 1.45;
}
.lp-ob-plan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lp-sp-1) var(--lp-sp-2);
  margin: var(--lp-sp-2) 0 0;
  color: var(--lp-muted);
  font-size: var(--lp-fs-xs);
}
.lp-ob-plan-name { color: var(--lp-text); font-weight: 500; }

/* Typing indicator: three dots, shown for about half a second. */
.lp-ob-dots {
  display: inline-flex;
  align-items: center;
  gap: var(--lp-sp-1);
  min-height: 36px;
}
.lp-ob-dots > span {
  width: 6px;
  height: 6px;
  border-radius: var(--lp-r-pill);
  background: var(--lp-muted);
  opacity: .5;
}

/* Answer choices for the open question, aligned with the message text above. */
.lp-ob-dock { padding-left: calc(24px + var(--lp-sp-2)); }
.lp-ob-dock:not(:has(> :not([hidden]))) { display: none; }
.lp-ob-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lp-sp-2);
}
.lp-ob-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--lp-sp-2);
  max-width: 100%;
  min-height: 40px;
  padding: var(--lp-sp-2) var(--lp-sp-4);
  border: 1px solid var(--lp-border-strong);
  border-radius: var(--lp-r-pill);
  background: var(--lp-surface-2);
  color: var(--lp-text);
  font: inherit;
  font-size: var(--lp-fs-sm);
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.lp-ob-chip:hover { border-color: var(--lp-accent); background: var(--lp-surface-3); color: var(--lp-text); }
/* Selected: fill plus a heavier edge, not colour alone. */
.lp-ob-chip[aria-pressed="true"] {
  border-color: var(--lp-primary);
  background: color-mix(in srgb, var(--lp-primary) 24%, transparent);
  box-shadow: inset 0 0 0 1px var(--lp-primary);
}
.lp-ob-chip-main {
  display: none;
  padding: 0 var(--lp-sp-2);
  border-radius: var(--lp-r-pill);
  background: var(--lp-primary-2);
  background: color-mix(in srgb, var(--lp-primary-2) 80%, var(--lp-bg));
  color: var(--lp-text);
  font-size: var(--lp-fs-xs);
  font-weight: 600;
  line-height: 1.6;
}
.lp-ob-chip.is-primary .lp-ob-chip-main { display: inline-block; }

.lp-ob-chip--go {
  border-color: color-mix(in srgb, var(--lp-primary) 70%, transparent);
  background: var(--lp-primary-2);
  background: color-mix(in srgb, var(--lp-primary-2) 80%, var(--lp-bg));
  font-weight: 600;
}
.lp-ob-chip--go:hover { border-color: var(--lp-accent); background: color-mix(in srgb, var(--lp-primary-2) 90%, var(--lp-bg)); }
.lp-ob-chip--go[disabled] {
  border-color: var(--lp-border);
  background: var(--lp-surface-2);
  color: var(--lp-muted);
  opacity: .6;
  cursor: not-allowed;
}
.lp-ob-chip--quiet {
  border-style: dashed;
  background: none;
  color: var(--lp-muted);
}
.lp-ob-note {
  margin: var(--lp-sp-2) 0 0;
  color: var(--lp-muted);
  font-size: var(--lp-fs-xs);
}

.lp-ob-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lp-sp-2);
}
.lp-ob-actions .lp-btn {
  min-height: 44px;
  padding: var(--lp-sp-2) var(--lp-sp-5);
  border-radius: var(--lp-r-pill);
  font-size: var(--lp-fs-sm);
}

/* ── Composer (only with the setup agent) ────────────────────────────── */
.lp-ob-composer {
  display: flex;
  flex-direction: column;
  gap: var(--lp-sp-1);
  margin: 0;
  padding-top: var(--lp-sp-3);
  border-top: 1px solid var(--lp-border);
}
.lp-ob-field {
  display: flex;
  align-items: center;
  gap: var(--lp-sp-2);
  padding: var(--lp-sp-1) var(--lp-sp-1) var(--lp-sp-1) var(--lp-sp-4);
  border: 1px solid var(--lp-faint); /* 3:1 field boundary */
  border-radius: var(--lp-r-pill);
  background: var(--lp-bg-2);
}
.lp-ob-field:focus-within {
  border-color: var(--lp-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lp-accent) 22%, transparent);
}
.lp-ob-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--lp-text);
  font: inherit;
  font-size: var(--lp-fs-base);
}
.lp-ob-input::placeholder { color: var(--lp-muted); opacity: 1; }
/* The field draws the focus ring for the input. */
.lp-ob .lp-ob-input:focus-visible { outline: none; }
.lp-ob-send {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--lp-primary) 70%, transparent);
  border-radius: var(--lp-r-pill);
  background: var(--lp-primary-2);
  background: color-mix(in srgb, var(--lp-primary-2) 80%, var(--lp-bg));
  color: var(--lp-text);
  cursor: pointer;
}
.lp-ob-send:hover { border-color: var(--lp-accent); }
.lp-ob-ask-note {
  margin: 0;
  padding-left: var(--lp-sp-4);
  color: var(--lp-muted);
  font-size: var(--lp-fs-xs);
}

/* ── Your EZPZ desk (builder, right column) ──────────────────────────── */
/* The desk itself is the shared component (personalize/_desk.html, desk.css,
   desk.js). This wrapper is the grid cell; the desk stretches to its height. */
.lp-build-deskwrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.lp-build-deskwrap > .ezd { flex: 1 1 auto; }

/* ── Small screens ───────────────────────────────────────────────────── */
@media (max-width: 479.98px) {
  .lp-hero { padding-block: var(--lp-sp-7) var(--lp-sp-6); }
  .lp-hero-lead { font-size: var(--lp-fs-base); margin-bottom: var(--lp-sp-5); }
  .lp-hero-actions .lp-btn { flex: 1 1 auto; }
  .lp-build { padding-top: var(--lp-sp-6); }
  .lp-ob { padding: var(--lp-sp-4); }
  .lp-ob-dock { padding-left: 0; }
  .lp-ob-chip { padding: var(--lp-sp-2) var(--lp-sp-3); }
  .lp-ob-msg--me .lp-ob-bubble { max-width: 92%; }
  .lp-ob-head { flex-wrap: wrap; }
}

/* ── Motion (only when the visitor has not asked for less) ───────────── */
@media (prefers-reduced-motion: no-preference) {
  .lp-ob-chip,
  .lp-ob-send,
  .lp-ob-field {
    transition: border-color var(--lp-dur) var(--lp-ease), background-color var(--lp-dur) var(--lp-ease),
                box-shadow var(--lp-dur) var(--lp-ease), color var(--lp-dur) var(--lp-ease);
  }
  .lp-ob-thread { scroll-behavior: smooth; }
  .lp-ob-meter > span { transition: background-color .4s var(--lp-ease); }
  /* The ring turns once on arrival and while the next question is being "typed"; otherwise still. */
  .lp-ob-orb::before { animation: lp-ob-spin 4.5s var(--lp-ease) 1; }
  .lp-ob.is-thinking .lp-ob-orb::before { animation: lp-ob-spin 1.2s linear infinite; }
  .lp-ob-msg.is-new { animation: lp-ob-rise .26s var(--lp-ease) both; }
  .lp-ob-step.is-in { animation: lp-ob-rise .3s var(--lp-ease) both; }
  .lp-ob-dots > span { animation: lp-ob-dot .9s ease-in-out infinite; }
  .lp-ob-dots > span:nth-child(2) { animation-delay: .15s; }
  .lp-ob-dots > span:nth-child(3) { animation-delay: .3s; }
}
@keyframes lp-ob-spin {
  to { transform: rotate(1turn); }
}
@keyframes lp-ob-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes lp-ob-dot {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}
