/* A quiet, full-width canvas for the new homepage content. */
body.home #content > .ast-container {
  display: block;
  max-width: none;
  padding: 0;
}

body.home #page,
body.home #content { background: transparent; }

body.home #primary {
  width: 100%;
  margin: 0;
  padding: 0;
}

.home-canvas {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 680px;
  min-height: max(680px, calc(100svh - 120px));
  background: transparent;
}

.home-hero {
  position: relative;
  z-index: 1;
  width: min(100%, 1000px);
  padding: 96px 24px 112px;
  text-align: center;
  font-family: "Google Sans Flex", system-ui, sans-serif;
  font-optical-sizing: auto;
}

body.home .home-hero__heading {
  margin: 0 0 32px;
  color: #eef4ff;
  font-family: inherit;
  font-size: clamp(42px, 6.2vw, 84px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.home-hero__intro,
.home-hero__emphasis { display: block; }
.home-hero__intro { font-weight: 500; }
.home-hero__emphasis { font-weight: 700; color: #b9d8ff; }

.home-hero__description {
  max-width: 620px;
  margin: 0 auto 16px;
  color: #d2ddec;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.6;
  text-wrap: pretty;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
}

.pill-hitbox { display: inline-flex; border-radius: 999px; }
body.home .expressive-pill {
  --pill-fill: #c9e1ff;
  --pill-ink: #102c48;
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  width: 190px;
  min-height: 60px;
  padding: 16px 28px;
  overflow: hidden;
  border: 1px solid #526d8d;
  border-radius: 999px;
  background: #213953;
  color: #d9e8ff;
  font: 600 16px/1.3 "Google Sans Flex", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 0 rgba(2, 10, 23, .28), 0 8px 20px rgba(2, 10, 23, .20), inset 0 1px 0 rgba(232, 244, 255, .16);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), border-color 240ms ease, box-shadow 220ms ease;
}

body.home .expressive-pill--primary {
  --pill-fill: #d5e8ff;
  background: #a9cfff;
  color: #102c48;
  border-color: transparent;
}

.expressive-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--pill-fill);
  border-radius: inherit;
  transform: translateX(-105%);
  transition: transform 560ms cubic-bezier(.2,.8,.2,1);
}

.expressive-pill__label {
  pointer-events: none;
  transition: opacity 180ms ease, transform 380ms cubic-bezier(.2,.8,.2,1), filter 180ms ease;
}

.expressive-pill__icon {
  position: absolute;
  inset: 0;
  margin: auto;
  pointer-events: none;
  width: 26px;
  height: 26px;
  opacity: 0;
  color: var(--pill-ink);
  transform: translateX(-14px) scale(.55) rotate(-35deg);
  transition: opacity 180ms ease, transform 360ms cubic-bezier(.2,.8,.2,1);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.expressive-pill:is(:focus-visible, [aria-busy="true"])::before { transform: translateX(0); }
.expressive-pill:is(:focus-visible, [aria-busy="true"]) .expressive-pill__label {
  opacity: 0;
  transform: translateX(16px) scale(.8);
  filter: blur(3px);
}
.expressive-pill:is(:focus-visible, [aria-busy="true"]) .expressive-pill__icon {
  opacity: 1;
  transform: translateX(0) scale(1) rotate(0);
}

@media (hover: hover) {
  .pill-hitbox:hover .expressive-pill::before { transform: translateX(0); }
  .pill-hitbox:hover .expressive-pill__label {
    opacity: 0;
    transform: translateX(16px) scale(.8);
    filter: blur(3px);
  }
  .pill-hitbox:hover .expressive-pill__icon {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0);
  }
  body.home .pill-hitbox:hover .expressive-pill { border-color: #b7d9ff; box-shadow: 0 4px 0 rgba(2, 10, 23, .24), 0 10px 24px rgba(2, 10, 23, .26), inset 0 1px 0 rgba(232, 244, 255, .24); }
}

body.home .expressive-pill:focus-visible { outline: 3px solid #e1edff; outline-offset: 5px; }
/* The surrounding hitbox stays stationary while the visible pill compresses. */
body.home .pill-hitbox:active .expressive-pill,
body.home .expressive-pill:active {
  transform: translateY(2px) scale(.96);
  box-shadow: 0 1px 0 rgba(2, 10, 23, .25), 0 3px 8px rgba(2, 10, 23, .18), inset 0 1px 2px rgba(16, 44, 72, .16);
}
.expressive-pill[aria-busy="true"] .expressive-pill__icon polyline {
  transform-origin: 12px 12px;
  animation: pill-loading 900ms linear infinite;
}
@keyframes pill-loading { to { transform: rotate(360deg); } }

.home-hero__action-status {
  min-height: 24px;
  margin: 16px 0 0;
  font-size: 14px;
  color: #b6c9e0;
}
.home-hero__action-status:empty { visibility: hidden; }
.expressive-pill__error-mark { opacity: 0; transition: opacity 200ms ease; }
.expressive-pill.has-connection-error::before { transform: translateX(0); }
.expressive-pill.has-connection-error .expressive-pill__label { opacity: 0; transform: translateX(16px) scale(.8); }
.expressive-pill.has-connection-error .expressive-pill__icon { opacity: 1; transform: none; }
.expressive-pill.has-connection-error .expressive-pill__error-mark { opacity: 1; transition-delay: 220ms; }
body.home .pill-hitbox .expressive-pill.is-recovering::before { transform: translateX(-105%); }
body.home .pill-hitbox .expressive-pill.is-recovering .expressive-pill__label { opacity: 1; transform: none; filter: none; }
body.home .pill-hitbox .expressive-pill.is-recovering .expressive-pill__icon { opacity: 0; transform: translateX(-14px) scale(.55); }
@media (prefers-reduced-motion: reduce) {
  .expressive-pill__error-mark { transition: none; }
}

@media (max-width: 440px) {
  .home-hero__actions { gap: 12px; }
  .pill-hitbox { width: min(100%, 240px); }
  body.home .expressive-pill { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  body.home .expressive-pill,
  .expressive-pill::before,
  .expressive-pill__label,
  .expressive-pill__icon { transition: none; }
  .expressive-pill[aria-busy="true"] .expressive-pill__icon polyline { animation: none; }
}

/* Broad, soft shading rather than sharp patterns or bright highlights. */
.home-canvas::before,
.home-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.home-canvas::before {
  mask-image: linear-gradient(180deg, transparent, #000 30%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%);
  background:
    radial-gradient(ellipse at 5% 45%, rgba(31, 101, 155, .12), transparent 44%),
    radial-gradient(ellipse at 95% 70%, rgba(57, 74, 145, .11), transparent 42%);
}

.home-canvas::after {
  background: linear-gradient(180deg, transparent 65%, rgba(2, 8, 20, .28));
}

.home-canvas__code {
  position: absolute;
  top: 16%;
  width: 28%;
  max-width: 370px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(128, 180, 222, .085);
  font: 12px/2.15 Consolas, "Courier New", monospace;
  letter-spacing: .035em;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  animation: code-drift 48s ease-in-out infinite alternate;
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12%, #000 70%, transparent);
}

.home-canvas__code--left { left: clamp(16px, 3vw, 60px); }
.home-canvas__code--right {
  right: clamp(16px, 3vw, 60px);
  top: 32%;
  animation-duration: 58s;
  animation-direction: alternate-reverse;
}

@keyframes code-drift {
  from { transform: translateY(12px); }
  to { transform: translateY(-24px); }
}

@media (max-width: 767px) {
  .home-canvas { min-height: max(580px, calc(100svh - 96px)); }
  .home-canvas__code {
    width: 30%;
    font-size: 10px;
    color: rgba(128, 180, 222, .06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-canvas__code { animation: none; }
}
