/* Start Building hero: halftone field + refined composer.
   Loads after onboarding.css and only restyles the hero. */
.build-hero {
  --hero-ink: #171717;
  --hero-tint: 47, 91, 255; /* the field's body colour; hero-field.js keeps it in sync */
  /* Headline-to-chips sits centred in the hero, nudged up a little by the larger bottom padding.
     The nav above is in flow (84px), so the hero fills the rest of the first screen. */
  align-items: center;
  min-height: max(700px, min(900px, calc(100svh - 84px)));
  padding: 40px 24px 104px;
  background: #fff;
  overflow: visible; /* the field runs on below the hero and fades out there */
}

/* Field */
.build-hero__atmosphere {
  inset: 0 0 -180px;
  background: none;
  opacity: 1;
  -webkit-mask-image: none;
  mask-image: none;
}
.build-hero:not(.build-hero--sheet) .build-hero__atmosphere { opacity: .68; }
.build-hero__atmosphere canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease;
  /* The fade happens in the tail below the hero, not inside it. */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 210px), transparent calc(100% - 6px));
  mask-image: linear-gradient(to bottom, #000 calc(100% - 210px), transparent calc(100% - 6px));
}
.build-hero__atmosphere.is-live canvas { opacity: 1; }
/* No WebGL: a still halftone in the same place. */
.build-hero__atmosphere.is-static {
  background:
    radial-gradient(circle at center, rgb(var(--hero-tint)) 0 1px, transparent 1.5px) 0 0 / 13px 13px,
    radial-gradient(circle at center, rgb(var(--hero-tint)) 0 1px, transparent 1.5px) 6.5px 6.5px / 13px 13px,
    radial-gradient(ellipse at 12% 82%, rgba(243, 221, 82, .14), transparent 64%),
    radial-gradient(ellipse at 88% 82%, rgba(var(--hero-tint), .2), transparent 70%);
  -webkit-mask-image: radial-gradient(130% 62% at 50% 104%, #000 22%, transparent 72%);
  mask-image: radial-gradient(130% 62% at 50% 104%, #000 22%, transparent 72%);
}

/* Keep the content clear, then dissolve the backdrop itself into the field.
   Blurring the whole silhouette avoids an opaque rounded edge around the dots. */
.build-hero:not(.build-hero--sheet) .build-hero__content {
  position: relative;
}
.build-hero:not(.build-hero--sheet) .build-hero__content::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -32px max(0px, calc((100% - 824px) / 2));
  border-radius: 96px;
  background: #fff;
  box-shadow: 0 0 56px 24px #fff;
  filter: blur(40px);
  pointer-events: none;
}

/* The next section sits over the field's tail, so it must not paint a background. */
.build-starters { position: relative; z-index: 1; padding-top: 64px; background: transparent; }

/* Copy */
.build-hero h1 {
  font-size: clamp(46px, 5.1vw, 72px);
  line-height: 1.04;
  letter-spacing: -.048em;
  color: var(--hero-ink);
  text-wrap: balance;
}
.build-hero__lead {
  margin-top: 18px;
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -.2px;
  color: #6b6b6b;
}

/* Composer: one calm white object lifted off the field. */
.build-composer {
  margin-top: 40px;
  padding: 20px 14px 14px 20px;
  border: 1px solid rgba(23, 23, 23, .09);
  border-radius: 22px;
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, .55),
    0 1px 1px rgba(23, 23, 23, .04),
    0 6px 14px -6px rgba(23, 23, 23, .10),
    0 28px 56px -24px rgba(var(--hero-tint), .12),
    0 48px 96px -40px rgba(23, 23, 23, .12);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.build-composer:focus-within {
  border-color: rgba(23, 23, 23, .22);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, .8),
    0 1px 1px rgba(23, 23, 23, .04),
    0 8px 18px -6px rgba(23, 23, 23, .12),
    0 34px 64px -24px rgba(var(--hero-tint), .18),
    0 56px 110px -40px rgba(23, 23, 23, .16);
}
.build-composer textarea { height: 40px; min-height: 40px; font-size: 16.5px; line-height: 24px; letter-spacing: -.1px; }
.build-composer textarea::placeholder { color: #9b9b9b; }
.build-icon-button { border-color: rgba(23, 23, 23, .1); border-radius: 10px; transition: background .15s, border-color .15s; }
.build-icon-button:hover { background: #f6f6f6; border-color: rgba(23, 23, 23, .16); }
.build-send { border-radius: 10px; background: var(--hero-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 4px rgba(23, 23, 23, .2); }
.build-send:disabled { background: #ececec; box-shadow: none; }

/* The page wraps the composer in a slot (it can float on scroll); keep the slot full width. */
.build-composer-slot { width: min(100%, 704px); }
.build-composer-slot > .build-composer { width: 100%; }

/* The hint and tags sit in the clear content area. */
.build-suggestions-hint {
  position: relative;
  isolation: isolate;
  margin-top: 40px;
  padding: 4px 12px 4px 9px;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: #171717;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}
.build-suggestions { gap: 8px; margin-top: 14px; }
.build-suggestion {
  min-height: 32px;
  padding: 4px 12px 4px 6px;
  border: 1px solid rgba(23, 23, 23, .08);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(23, 23, 23, .04), 0 8px 20px -10px rgba(23, 23, 23, .22);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: #3d3d3d;
  font-weight: 500;
  transition: transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s, border-color .2s;
}
.build-suggestion:hover {
  background: #fff;
  border-color: rgba(23, 23, 23, .16);
  box-shadow: 0 1px 1px rgba(23, 23, 23, .04), 0 14px 26px -12px rgba(23, 23, 23, .3);
  transform: translateY(-2px);
}
.build-hero__scroll {
  bottom: 36px;
  width: 36px;
  height: 36px;
  border-color: rgba(23, 23, 23, .08);
  background: #fff;
  box-shadow: 0 8px 20px -10px rgba(23, 23, 23, .3);
}

/* Entrance: copy settles while the field fades up underneath. */
@media (prefers-reduced-motion: no-preference) {
  .build-hero__content > * { animation: build-hero-rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .build-hero__content > :nth-child(2) { animation-delay: .06s; }
  .build-hero__content > :nth-child(3) { animation-delay: .14s; }
  .build-hero__content > :nth-child(n + 4) { animation-delay: .24s; }
  @keyframes build-hero-rise { from { opacity: 0; transform: translateY(14px); } }
}
@media (prefers-reduced-motion: reduce) {
  .build-hero__atmosphere canvas, .build-suggestion { transition: none; }
  .build-suggestion:hover { transform: none; }
}

@media (max-width: 1120px) {
  .build-hero { min-height: max(700px, min(820px, calc(100svh - 84px))); padding-top: 40px; padding-bottom: 104px; }
}
@media (max-width: 600px) {
  .build-hero { min-height: max(640px, calc(100svh - 76px)); padding: 32px 20px 96px; }
  .build-hero h1 { font-size: clamp(36px, 10.4vw, 44px); letter-spacing: -.04em; }
  .build-hero__lead { margin-top: 14px; font-size: 15.5px; line-height: 24px; }
  .build-composer { margin-top: 30px; padding: 16px 12px 12px 16px; border-radius: 20px; }
  .build-suggestions-hint { max-width: none; margin-top: 32px; font-size: 13px; white-space: nowrap; }
  .build-suggestion { font-size: 12.5px; }
  .build-hero__atmosphere { inset: 0 0 -130px; }
  .build-starters { padding-top: 48px; }
}

/* ---------------------------------------------------------------------------
   Hero v2 (?hero=v2): a spreadsheet of pastel cells, built by hero-sheet.js.
   --------------------------------------------------------------------------- */
.build-hero--sheet { --hero-tint: 70, 200, 130; --sheet-select: #111; }
.build-hero--sheet .build-hero__atmosphere { inset: 0; }
.build-hero--sheet + .build-starters { padding-top: 96px; }
.build-hero__sheet, .build-hero__sheet-cursor { position: absolute; top: 0; left: 0; }
.build-hero__cell {
  position: absolute;
  /* Thin white gridlines, drawn inside each cell so neighbours never double up. */
  box-shadow: inset 0 0 0 .75px #fff;
  transition: background-color 1.6s ease;
}

/* Fill-in on first load: cells drop into place from the bottom up. */
.build-hero__sheet.is-filling .build-hero__cell { animation: build-hero-cell .5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes build-hero-cell { from { opacity: 0; transform: translateY(-10px) scale(.96); } }

/* Selected cell. */
.build-hero__sheet-cursor {
  box-sizing: border-box;
  border: 2px solid var(--sheet-select);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, .12);
  opacity: 0;
  pointer-events: none;
  transition: transform .12s cubic-bezier(.2, .7, .2, 1), opacity .15s;
}
.build-hero__sheet-cursor.is-on { opacity: 1; }
.build-hero__sheet-cursor::after { content: ''; position: absolute; right: -5px; bottom: -5px; width: 7px; height: 7px; border: 1.5px solid #fff; background: var(--sheet-select); }
@media (prefers-reduced-motion: reduce) {
  .build-hero__cell, .build-hero__sheet-cursor { transition: none; }
}
