.public-home {
  --home-width: 1160px;
  --home-gutter: clamp(20px, 5vw, 72px);
  --home-connect-gap: clamp(24px, 4.3svh, 43px);
  --home-fan-peek: clamp(24px, 50svh - 235px, 15vw);
  --home-accent: var(--mcp-accent);
  --home-surface: #1a1b18;
  line-height: 1.8;
}

.public-home h1,
.public-home h2,
.public-home h3 {
  font-family: inherit;
  text-wrap: balance;
}

.public-home :is(h1, h2, h3, p) { margin: 0; }
.public-home section[id], .home-mcp { scroll-margin-top: 18px; }
.public-home p { text-wrap: pretty; }

.home-hero {
  --hero-inset: clamp(36px, 7svh, 72px);
  position: relative;
  display: grid;
  place-items: center;
  /* Reserve space for the overlapping sheets, including their tilted corners. */
  grid-template-rows: minmax(var(--hero-inset), 1fr) auto minmax(calc(var(--home-fan-peek) + var(--home-connect-gap) + .6vw), 1fr);
  height: 100svh;
  min-height: min-content;
  padding: 0 var(--home-gutter);
  background: radial-gradient(ellipse at 50% 38%, #152036, #10141d 58%, var(--bg) 92%);
  border-bottom: 1px solid transparent;
}

.home-hero__brand { position: absolute; z-index: 1; top: clamp(16px, 3svh, 30px); left: clamp(16px, 3vw, 48px); }

.home-hero__art {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: .82;
}

.home-hero__art :is(picture, img, video) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-hero__art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 82%, var(--bg)), radial-gradient(ellipse at 50% 48%, #0e1420c9 2%, transparent 62%);
}
.home-hero__art video { opacity: 0; }
.home-hero__art video[data-started] { opacity: 1; }
.home-hero__inner { grid-row: 2; z-index: 1; width: min(100%, 840px); text-align: center; }
.home-hero__labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 7px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  color: rgb(255 255 255 / .65);
  font-size: 12px;
  line-height: 1.5;
}
.home-hero__labels li {
  padding: 2px 8px;
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: 3px;
}
.home-hero h1 {
  color: #f6f3e9;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.052em;
  word-break: auto-phrase;
}
.public-home .home-hero__lead { margin: 12px auto 0; max-width: 46em; color: #ccc9c0; font-size: 15px; line-height: 1.7; white-space: pre-line; word-break: auto-phrase; text-wrap: balance; }
.home-prompt { margin: clamp(20px, 3svh, 30px) 0 0; text-align: left; }
.home-prompt__field {
  padding: 18px 16px 12px 23px;
  background: #232322f7;
  border: 1px solid #ffffff38;
  border-radius: 21px;
  box-shadow: 0 14px 44px #0004;
}
.home-prompt__field:focus-within { border-color: var(--home-accent); }
.home-prompt__field textarea {
  display: block;
  width: 100%;
  height: 70px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  resize: none;
}
.home-prompt__field textarea::placeholder { color: #b6b5af; }
.home-prompt__field textarea:focus-visible { outline: 0; }
.home-prompt__submit {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #26200c;
  background: var(--home-accent);
  cursor: pointer;
}
.home-prompt__submit:hover { background: #f8df84; }
.home-prompt__submit:disabled { opacity: .6; cursor: default; }
.home-prompt__meta { display: flex; align-items: center; gap: 14px; margin-top: 4px; color: #b5b3ab; font-size: 12px; }
.home-prompt__samples { position: relative; }
.home-prompt__samples summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  cursor: pointer;
  list-style: none;
}
.home-prompt__samples summary::-webkit-details-marker { display: none; }
.home-prompt__samples summary::after { content: ''; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg); }
.home-prompt__samples[open] summary::after { transform: translateY(1px) rotate(225deg); }
.home-prompt__samples div {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 100%;
  min-width: 160px;
  padding: 5px;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: #232320;
  box-shadow: 0 8px 20px #0005;
}
.home-prompt__samples button { display: block; width: 100%; padding: 8px 11px; border: 0; border-radius: 5px; text-align: left; font: inherit; color: var(--fg); background: transparent; cursor: pointer; }
.home-prompt__samples button:hover, .home-prompt__samples button:focus-visible { background: #35342d; }
.home-prompt__consent { display: flex; align-items: center; gap: 6px; min-height: 34px; margin-left: auto; cursor: pointer; }
.home-prompt__consent input { width: 14px; height: 14px; margin: 0; accent-color: var(--home-accent); }
.home-prompt__consent a { color: inherit; }
.home-mcp { margin-top: var(--home-connect-gap); }
.theme-mcp .home-mcp .mcp-connection { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; width: 100%; max-width: none; margin: 0; }
.home-mcp .mcp-connection__clients { display: flex; align-items: center; gap: 7px; }
.home-mcp .mcp-connection__clients img { display: block; width: 18px; height: 18px; }
.theme-mcp .home-mcp .mcp-connection__label { margin: 0; color: #e6e4dc; font-size: clamp(15px, 1.3vw, 18px); font-weight: 600; line-height: 1.5; letter-spacing: normal; }
.theme-mcp .home-mcp .mcp-connection__field { grid-column: 1 / -1; grid-row: 2; min-width: 0; flex-wrap: nowrap; padding: 0 2px 0 12px; border: 1px solid #ffffff23; border-radius: 9px; background: #181817e8; box-shadow: none; }
.theme-mcp .home-mcp .mcp-connection__endpoint { padding: 8px 0; color: #c9c8c0; font-size: 12px; }
.theme-mcp .home-mcp .mcp-connection__copy { width: 36px; min-height: 38px; padding: 0; color: #c9c8c0; background: transparent; }
.theme-mcp .home-mcp .mcp-connection__copy:hover { color: var(--home-accent); }
.home-mcp .mcp-connection__note { display: none; }
.home-mcp .mcp-connection__actions { grid-area: 1 / -2; justify-self: end; margin: 0; }
.home-mcp .mcp-connection__actions a { font-size: 11px; color: #aaa9a2; }
.theme-mcp .home-mcp .mcp-connection__status { grid-column: 1 / -1; margin: 0; min-height: auto; color: var(--home-accent); }
.theme-mcp .home-mcp .mcp-connection__status:empty { display: none; }

.public-home .home-estimate-samples { display: flow-root; width: 100%; margin: 0; padding: 0 clamp(10px, 1.6vw, 32px) 24px; }
/* The paper fan rises into the hero, then scrolls away with the document. */
.home-estimate-samples .mcp-output__fan { margin-block-start: calc(-1 * var(--home-fan-peek)); }

.home-chapter, .home-catalog, .home-film {
  width: min(var(--home-width), calc(100% - 2 * var(--home-gutter)));
  margin-inline: auto;
  padding-block: clamp(64px, 11svh, 128px);
  border-bottom: 1px solid var(--stroke);
}

.home-chapter {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: clamp(20px, 3svh, 36px);
  padding: clamp(36px, 5svh, 74px) 0;
}

.home-chapter__copy { display: grid; justify-items: center; gap: 16px; text-align: center; }
.home-chapter h2, .home-catalog h2, .home-film h2 { font-size: clamp(28px, 3.6vw, 54px); line-height: 1.26; letter-spacing: -.05em; text-align: left; }
.home-chapter h2 { text-align: center; word-break: auto-phrase; }
.home-chapter h2 small { display: block; margin-bottom: .4em; color: var(--muted); font-size: .52em; font-weight: 500; letter-spacing: 0; }
.home-chapter h2 span { display: inline-block; }
.home-chapter p { max-width: 43em; color: var(--muted); font-size: 15px; word-break: auto-phrase; }
.home-chapter__copy .public-trial-cta__button { gap: 16px; margin-top: 2px; }
.home-link { font-size: 14px; text-decoration: none; text-underline-offset: 4px; }
.home-link span { margin-left: 4px; color: var(--home-accent); }
.home-link:hover { text-decoration: underline; }
.home-film__intro { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: clamp(24px, 5vw, 72px); margin-bottom: clamp(24px, 4vw, 46px); }
.home-film__intro p { margin-bottom: 10px; color: var(--muted); font-size: 15px; }
.home-demo { min-width: 0; margin: 0; }
.home-demo__chapters { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 14px; }
.home-demo__chapters button {
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.home-demo__chapters button:is([aria-current], :hover) { border-color: var(--home-accent); color: var(--fg); }
.home-demo video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  border: 1px solid #dfe8ce28;
  border-radius: 12px;
  background: var(--home-surface);
  box-shadow: 0 16px 60px #0007;
}
.home-demo figcaption { margin-top: 12px; color: var(--muted); font-size: 12px; text-align: center; }

.home-catalog__header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.home-catalog__group { display: grid; grid-template-columns: minmax(160px, .75fr) minmax(0, 2fr); gap: 12px 26px; padding: 18px 0; border-top: 1px solid var(--stroke); }
.home-catalog__group h3 { color: var(--fg); font-size: 16px; }
.home-catalog__group ul { display: flex; flex-wrap: wrap; gap: 9px 24px; list-style: none; margin: 0; padding: 0; }
.home-catalog__group li { color: var(--muted); }
.home-catalog__group .home-link span { visibility: hidden; }
.home-catalog__group .home-link:is(:hover, :focus-visible) span { visibility: visible; }

@media (max-width: 840px) {
  .home-film__intro { grid-template-columns: 1fr; align-items: start; gap: 16px; }
}

@media (max-width: 580px) {
  .home-hero { padding-inline: 16px; }
  .home-hero__labels { gap: 4px 5px; font-size: 11px; }
  .home-hero__labels li { padding-inline: 5px; }
  .public-home .home-hero__lead { margin-top: 8px; font-size: 13px; }
  .home-prompt__field { padding: 16px 12px 10px 16px; border-radius: 18px; }
  .home-prompt__field textarea { height: 62px; }
  .home-prompt__meta { gap: 10px; }
  .home-prompt__submit { width: 42px; height: 42px; }
  .home-catalog__group { grid-template-columns: 1fr; }
  .home-catalog__group ul { gap: 6px 16px; }
}
@media (max-width: 540px) {
  .public-home { --home-fan-peek: clamp(24px, 50svh - 235px, 19vw); }
}
@media (max-width: 480px) {
  .theme-mcp .home-mcp .mcp-connection { grid-template-columns: 1fr auto; }
  .theme-mcp .home-mcp .mcp-connection__label { grid-column: 1 / -1; }
  .home-mcp .mcp-connection__clients { grid-area: 3 / 1; }
  .home-mcp .mcp-connection__actions { grid-area: 3 / 2; }
}
@media (max-width: 365px) {
  .theme-mcp .home-mcp .mcp-connection__endpoint { font-size: 10px; }
}
@media (max-width: 365px) and (max-height: 600px) {
  .public-home { --home-connect-gap: clamp(18px, 3.5svh, 22px); }
  .home-hero { --hero-inset: 48px; }
  .home-prompt { margin-top: 14px; }
  .home-prompt__field textarea { height: 46px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .public-home { --home-connect-gap: 14px; }
  .home-hero { --hero-inset: 14px; }
  .home-hero__brand { top: 10px; left: 14px; gap: 6px; font-size: 14px; }
  .home-hero__labels { margin-bottom: 5px; }
  .public-home .home-hero__lead { margin-top: 4px; font-size: 12px; }
  .home-prompt { margin-top: 12px; }
  .home-prompt__field textarea { height: 46px; }
}
