/* "Design with AI" (public/design-with-ai.js): a chat. What was asked and
   what was made stack up the page; the box stays at the bottom. */
.ai-design {
  display: flex;
  flex-direction: column;
  max-width: 1120px;
  min-height: calc(100dvh - 86px);
  padding-bottom: 0;
}
.ai-top h1 {
  margin-bottom: 8px;
}
.ai-lede {
  color: var(--muted-strong);
  margin: 0;
  max-width: 56ch;
}
.ai-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 34px;
  padding: 28px 0 22px;
}

/* One thing the shopper sent, and what came of it. */
.ai-said {
  align-self: flex-end;
  width: fit-content;
  max-width: min(640px, 88%);
  margin: 0 0 16px auto;
  padding: 12px 18px;
  border-radius: var(--radius-round) var(--radius-round) var(--radius-small) var(--radius-round);
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.ai-about {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  opacity: 0.7;
}
.ai-status {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  margin: 0 0 16px;
}
.ai-status.failed {
  color: var(--danger);
}
.ai-concepts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}
.ai-concepts.single {
  grid-template-columns: minmax(0, 720px);
}
.ai-concepts.single .ai-sides {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.ai-concept {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.ai-concept h3 {
  font-size: 18px;
  margin: 14px 0 4px;
}
.ai-idea {
  color: var(--muted-strong);
  margin: 0 0 8px;
  font-size: 14px;
}
.ai-stage {
  min-height: 1.4em;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.ai-concept.failed .ai-stage {
  color: var(--danger);
}
.ai-sides {
  align-self: stretch;
  display: grid;
  gap: 10px;
}
.ai-sides img,
.ai-blank {
  display: block;
  width: 100%;
  aspect-ratio: 7 / 4;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-card);
}
.ai-blank {
  background: linear-gradient(100deg, var(--line) 30%, color-mix(in srgb, var(--line) 40%, white) 50%, var(--line) 70%);
  background-size: 300% 100%;
  animation: ai-wait 1.6s linear infinite;
}
@keyframes ai-wait {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}
.ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}
.ai-test {
  margin-top: 20px;
  padding: 10px 12px;
  border: 1px dashed var(--accent-rule);
  border-radius: var(--radius);
  color: var(--muted-strong);
  font: 12px/1.5 ui-monospace, monospace;
  overflow-wrap: anywhere;
}

/* The box, held at the bottom of the window. */
.ai-composer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 14px 0 18px;
  background: linear-gradient(to bottom, transparent, var(--paper) 22px);
}
.ai-aim {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin: 0 0 8px 6px;
  padding: 5px 6px 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--ink);
  font-size: 13px;
}
.ai-aim button {
  padding: 4px 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.ai-ask {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 12px 12px 18px;
  background: white;
  border: 1.5px solid var(--accent-rule);
  border-radius: var(--radius-round);
  box-shadow: var(--shadow-card);
}
.ai-ask:focus-within {
  border-color: var(--ink);
}
.ai-ask textarea {
  flex: 1;
  min-height: 56px;
  max-height: 180px;
  padding: 6px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  line-height: 1.4;
  field-sizing: content;
}
.ai-send {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
.ai-send svg {
  display: block;
  fill: none;
  stroke: var(--paper);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ai-send:disabled {
  opacity: 0.4;
  cursor: default;
}
.ai-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin: 12px 4px 0;
}
.ai-product {
  display: flex;
  flex-direction: row;
  align-items: center;
  font-size: 14px;
  gap: 8px;
  margin: 0;
}
.ai-product select {
  width: auto;
}
.ai-tiers {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.ai-tiers label {
  position: relative;
  cursor: pointer;
}
/* The radio itself is hidden but still focusable. It must be given a size:
   the shop's inputs are full width, and a full-width input placed off its
   label made the whole page scroll sideways (seen on an iPad, 2026-10-10). */
.ai-tiers input {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  clip-path: inset(50%);
}
.ai-tiers span {
  display: block;
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted-strong);
  font-size: 14px;
}
.ai-tiers b {
  color: var(--ink);
  margin-right: 4px;
}
.ai-tiers input:checked + span {
  border-color: var(--ink);
  background: var(--accent);
  color: var(--ink);
}
.ai-tiers input:focus-visible + span {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}
.ai-browse {
  color: var(--muted-strong);
  font-size: 14px;
  text-underline-offset: 4px;
}

/* The examples: three designs load above the box, one after another, faintly. */
.ai-demo {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.ai-demo.shown {
  opacity: 1;
}
.ai-demo-card {
  position: relative;
  margin: 0;
  aspect-ratio: 7 / 4;
}
.ai-demo-card .ai-blank {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  box-shadow: none;
  transition: opacity 0.5s ease;
}
.ai-demo-card svg {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
}
.ai-demo-card.in svg {
  opacity: 0.45;
  transform: none;
}
.ai-demo-card.in .ai-blank {
  opacity: 0;
}

/* On the home page: a section under the store's introduction. */
.ai-band {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  align-items: end;
  gap: 40px 5%;
  padding: 54px 6%;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 16%, var(--paper));
}
.ai-band h2 {
  font-size: clamp(30px, 3.4vw, 46px);
  letter-spacing: -0.045em;
  line-height: 1.08;
  margin: 0 0 14px;
}
.ai-band h2 em,
.ai-hero h1 em {
  font-family: var(--font-accent);
  font-weight: 400;
}
.ai-band-copy > p:not(.ai-kicker) {
  color: var(--muted-strong);
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 44ch;
}
.ai-kicker {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ai-band .ai-demo {
  gap: 14px;
}

/* On the home page: the whole hero (GOODSIDE_AI_HOME=hero). */
.ai-hero {
  padding: 62px 6% 54px;
  border-bottom: 1px solid var(--line);
}
.ai-hero-copy,
.ai-hero .ai-ask,
.ai-hero .ai-choices,
.ai-hero .ai-demo {
  max-width: 980px;
}
.ai-hero h1 {
  font-size: clamp(44px, 5.6vw, 82px);
  letter-spacing: -0.06em;
  line-height: 1.03;
  margin-bottom: 18px;
}
.ai-hero-copy > p:not(.ai-kicker) {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 26px;
  max-width: 52ch;
}

/* The store's introduction when AI design shares the home page: what it prints. */
.hero-range {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}
.hero-range a {
  display: block;
  padding: 7px 13px;
  border: 1px solid var(--accent-rule);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
}
.hero-range a:hover {
  background: var(--soft);
}

@media (prefers-reduced-motion: reduce) {
  .ai-blank {
    animation: none;
  }
  .ai-demo,
  .ai-demo-card svg,
  .ai-demo-card .ai-blank {
    transition: none;
  }
}
@media (max-width: 900px) {
  .ai-band {
    grid-template-columns: 1fr;
    padding: 40px 20px;
  }
}
@media (max-width: 720px) {
  .ai-ask textarea {
    font-size: 16px;
  }
  .ai-hero {
    padding: 40px 20px 36px;
  }
  .ai-demo {
    gap: 10px;
  }
  .ai-said {
    font-size: 15px;
  }
}
